![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Posts: 133
|
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 |
|
Board Regular
Join Date: Mar 2002
Location: =ActiveCell.Address
Posts: 478
|
Like this?...
Range(Selection, Selection.End(xlDown)).Select |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Posts: 133
|
That works perfectly but I also need it to select to the right as well ? i.e all the data on the worksheet.
|
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Mar 2002
Location: =ActiveCell.Address
Posts: 478
|
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 |
|
Board Regular
Join Date: Feb 2002
Posts: 133
|
Many thanks AJ - it works perfectly.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|