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

Thread: Range.

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Posts
    133
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    How do you highlight a dynamic range in VBA I guess it's something along the lines of Selection.End(xlDown).Select - but as a range.

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    =ActiveCell.Address
    Posts
    478
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Like this?...
    Range(Selection, Selection.End(xlDown)).Select

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Posts
    133
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    That works perfectly but I also need it to select to the right as well ? i.e all the data on the worksheet.

  4. #4
    Board Regular
    Join Date
    Mar 2002
    Location
    =ActiveCell.Address
    Posts
    478
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I just recorded this...

    Range(Selection, Selection.End(xlDown)).Select
    Range(Selection, Selection.End(xlToRight)).Select

    Or to do it in one line, using the SpecialCells method:

    Range(Selection, Cells.SpecialCells(xlLastCell)).Select

  5. #5
    Board Regular
    Join Date
    Feb 2002
    Posts
    133
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Many thanks AJ - it works perfectly.

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
  •