+ Reply to Thread
Results 1 to 7 of 7

select range of cells and replace

  1. #1
    Forum Contributor
    Join Date
    11-24-2008
    Location
    leicester
    MS-Off Ver
    Microsoft 365
    Posts
    161

    select range of cells and replace

    Hi,

    I have wrote th below, but it only selects the last column, rather than all 5 i though it would - what am i missing?

    thanks

    Antony

    Please Login or Register  to view this content.
    Last edited by shg; 12-12-2008 at 05:13 PM. Reason: code tags

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    Try:
    Please Login or Register  to view this content.
    In place of those first 5 lines of code. That presumes there are blank cells around the data you're copying.
    Last edited by JBeaucaire; 12-12-2008 at 04:45 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Valued Forum Contributor mdbct's Avatar
    Join Date
    11-11-2005
    Location
    CT
    MS-Off Ver
    2003 & 2007
    Posts
    848
    The following will select N2 and the five columns to the right of N2 or N2:S2
    Please Login or Register  to view this content.



    in order to avoid the wrath of a moderator please edit your first post to surround your code with code tags
    Looks like my warning came a little too late
    Last edited by mdbct; 12-12-2008 at 05:20 PM.

  4. #4
    Forum Contributor
    Join Date
    11-24-2008
    Location
    leicester
    MS-Off Ver
    Microsoft 365
    Posts
    161
    mdbct,

    I have tried as you suggested, however it selects the whole column, where as i need it to only select from row below my heading , and to the same row downwards as the column next to n..... hence i was trying to use xlup/xldown.

    Any other thoughts?

    Thanks

    Antony

  5. #5
    Forum Contributor FRIEL's Avatar
    Join Date
    03-07-2008
    Location
    Coventry
    MS-Off Ver
    2003 and 2007
    Posts
    266
    this will select all the cells in columns N:S apart from row 1

    Please Login or Register  to view this content.
    providing that col n has no missing values

    Please Login or Register  to view this content.
    this will do the replace u wanted




    ahh my bad this works

    Please Login or Register  to view this content.
    Last edited by FRIEL; 12-15-2008 at 06:58 AM.
    I dont like to use code i dont understand
    it makes it hard to use in other situations
    so please try to be as clear and patent as possible with me

    Criticism is welcomed

  6. #6
    Forum Contributor
    Join Date
    11-24-2008
    Location
    leicester
    MS-Off Ver
    Microsoft 365
    Posts
    161
    friel,
    i think im half way there - your code works if all the selected area is blank, the issue i have is that some lines will have data, im just trying to fill the blanks around these lines - any suggestions?

    Many thanks for the help though

    A

  7. #7
    Forum Contributor FRIEL's Avatar
    Join Date
    03-07-2008
    Location
    Coventry
    MS-Off Ver
    2003 and 2007
    Posts
    266
    the way i under stand it is in cols N:S
    there are cells with nothing in and cells with data in
    is this correct??

    if otherwise could you provide an example?
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1