Thread: Range Selection
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Range Selection

lastrow=cells(rows.count,"b").end(xlup).row
range("b2").AutoFill Destination:=Range("B2:B"&lastrow)


--
Don Guillett
SalesAid Software

"Pete" wrote in message
...
Hi,

I have a line of code :
Selection.AutoFill Destination:=Range("B2:B34461")

The number of rows refers to data which increases on a daily basis - I
have
to manually increase the row number (e.g. B34461) each time the data
increases.

Is there a way I can change the line so it automatically picks up the last
row of the spreadsheet that has data on it ?

Many Thanks
Pete