View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
swatsp0p[_41_] swatsp0p[_41_] is offline
external usenet poster
 
Posts: 1
Default finding next empty row from bottom up!!


swatsp0p Wrote:
Use this code:Sub lastrow()
Dim rRng As Range
Set rRng = Range("A1:A" & Range("A"
Rows.Count).End(xlUp).Row)
With rRng.Offset(rRng.Count, 0).Resize(1, 1).Select
End With
End Sub

places cursor in cell A99999 where 99999=the first row below the las
entry in column A


Of course for Column B, simply change the reference in the above cod
from 'A' to 'B' each place it occurs.

Also, I forgot to mention that if you want to skip 1 or more rows belo
the last entry, adjust the "Offset(rRng.Count, 0)" by changing the zer
to as many rows as you want to skip. e.g to leave 2 blank rows, chang
the zero to a 2. If the last active row was 100, the cursor would b
placed in 103 (skipping 101 & 102).

You can assign this code to a button or simply run it by pressin
Alt+F8 and selecting "lastrow" from the list.

Does this work for you

--
swatsp0

-----------------------------------------------------------------------
swatsp0p's Profile: http://www.excelforum.com/member.php...fo&userid=1510
View this thread: http://www.excelforum.com/showthread.php?threadid=48100