Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am writing an Excel 2002 template and wish to use VBA to 'highlight' a
range from A3 to the last cell. The row of the last cell will vary but will always be in column N. My VBA knowledge is limited. I have tried and failed with Range ("A3").SpecialCells(xlLastCell).Activate and I am not sure if I need 'Select' or 'Activate' to 'highlight' the range. When complete, the worksheet view should show A1 as the top left (home) cell rather than (for example) N999 at the bottom right. Thanks in anticipation. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
With the usual caveat that it is extremely unlikely you need to select this range to do what you want to do Dim LastRow As Long Set sht = Sheets("Sheet1") LastRow = sht.Cells(Cells.Rows.Count, "N").End(xlUp).Row sht.Range("A3:N" & LastRow).Select -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "Grey Old Man" wrote: I am writing an Excel 2002 template and wish to use VBA to 'highlight' a range from A3 to the last cell. The row of the last cell will vary but will always be in column N. My VBA knowledge is limited. I have tried and failed with Range ("A3").SpecialCells(xlLastCell).Activate and I am not sure if I need 'Select' or 'Activate' to 'highlight' the range. When complete, the worksheet view should show A1 as the top left (home) cell rather than (for example) N999 at the bottom right. Thanks in anticipation. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find Last cell in Range when range is date format | Excel Discussion (Misc queries) | |||
RANGE EXCEL copy cell that meets criteria in a range | Excel Worksheet Functions | |||
copy range and paste into every 3rd cell of new range | New Users to Excel | |||
Referencing a named range based upon Range name entry in cell | Excel Worksheet Functions | |||
Selecting range in list of range names depending on a cell informa | Excel Discussion (Misc queries) |