Thread: last record
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default last record

Hi,

If I've understood correctly, try this:-

Sub stance()
Dim lastrecordAGING As Long
lastrecordAGING = Range("AE5000").End(xlUp).Offset(0, 0).Row
lastcell = Range("E2").End(xlToRight).Offset(0, 1).Address
Range(lastcell & ":AE" & lastrecordAGING).Select
End Sub


Mike

"geebee" wrote:

hi,

i have the following:

Dim lastrecordAGING As Long
Range("AE5000").End(xlUp).Offset(0, 0).Select
lastrecordAGING = Selection.Row
Range("E2").End(xlToRight).Offset(0, 1).Select
Range(Selection, Selection.End(xlDown)).Select

i am trying to figure out how i can amend the lasdt line so that it only
selects up to the lastrecordAGING.

thanks in advance,
geebee