Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Autofill to last row

I Have a calculation in M4 and I want it to autofill to the end of the data.
But the data could end in row 35 or 50 etc. How would I find the last row of
data and autofill the formula down to it

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Autofill to last row

which column has the data? i used L on Sheet1 in this example

sub fill()

dim lastrow as long
lastRow = Worksheets("Sheet1").Cells(Rows.Count, "L").End(xlUp).Row


Range("M4").AutoFill Range("m4:m" & lastRow)

end sub
--


Gary


"Nigel" wrote in message
...
I Have a calculation in M4 and I want it to autofill to the end of the
data.
But the data could end in row 35 or 50 etc. How would I find the last row
of
data and autofill the formula down to it

Thanks




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
AutoFill Sherbear New Users to Excel 2 January 28th 06 02:53 AM
Autofill paulinoluciano Excel Worksheet Functions 8 December 28th 05 06:00 PM
Autofill: Need to autofill one week block, (5) weekday only into cells. dstock Excel Discussion (Misc queries) 1 June 17th 05 08:21 PM
Q. Autofill question: Can I autofill alpha characters like I can numbers? George[_22_] Excel Programming 5 August 7th 04 10:33 AM
Autofill help Patrick Simonds Excel Programming 1 June 12th 04 04:57 AM


All times are GMT +1. The time now is 05:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"