Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The only way i know of to do it and be absolutely sure that it i
correct Sub Macro1() Dim i As Integer Dim r As Long Dim t As Long For i = 1 To 5 Step 1 t = Cells(65536, i).End(xlUp).Row If t r Then r = t End If Next i If r 1 Then Range("a2:e" & r).Select End If End Sub you could also use If rows have nbeen deleted from the bottom of you sheet this wil include those deleted rows in the row so you could end up with severa blank rows at the bottom selected sub Macro2 dim r as long r=Range("a1").SpecialCells(xlLastCell).Row range("a2:e" & r).select) end sub If rows have nbeen deleted from the bottom of you sheet this wil include those deleted rows in the row so you could end up with severa blank rows at the bottom selecte -- Message posted from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
CODE 2 SELECT SHEETS LISTED IN A RANGE | Excel Discussion (Misc queries) | |||
How can change range to select active rows instead of :=Range("S10 | Excel Discussion (Misc queries) | |||
Code to select range | Excel Discussion (Misc queries) | |||
How do I select this range using code? | Excel Programming | |||
CODE to select range based on User Input or Value of Input Field | Excel Programming |