Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Quick Range question

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    Stockton, California
    Posts
    281
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi,

    Im having a hard time trying to do the following.

    I want my macro to copy a range, but the range will always be different. I would like to find the last cell with data in column B, and the returned row will be the last row in my range. Then, I would like to select A1:D(whatever row the search in B returned). I can find the last row in B with :
    Worksheets("Changes Sheet").Range("B65536").End(xlUp)

    But how do i specify the range A1 to D and this row?

    Many thanks!

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,959
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default


    lrow = Worksheets("Changes Sheet").Range("B65536").End(xlUp).Row
    Set MyRange = Worksheets("Changes Sheet").Range("A1","D" & lrow)

    or

    Set MyRange = Worksheets("Changes Sheet").Range("A1", Worksheets("Changes Sheet").Range("B65536").End(xlUp).Offset(,2))
    Regards,

    Juan Pablo González
    http://www.juanpg.com

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Location
    Stockton, California
    Posts
    281
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    thanks very much Juan!

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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