Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autofill rows to last used row

Status
Not open for further replies.
Feb 9, 2003
21
NZ
Hi All,

What I am needing to achieve is to fill down a formula that is in the "C" column down to the last row that has data in it (in the "A" column).

If this is not possible, I have set up a count to check how many rows are used but can't work out how to include this in the vba to use this value as the row to fill down to.

Thanks
 
Summat like this should do it

Code:
Sub a()
Dim lRow As Long
lRow = [a65536].End(xlUp).Row
Range("C1").AutoFill Range("C1:C" & lRow)
End Sub

;-)

If a man says something and there are no women there to hear him, is he still wrong? [ponder]
The faqs ma'am, just the faqs. Get the best from these forums : faq222-2244
 
not sure by original post if you needed a VBA/coded solution, but I know some people aren't aware in XL that you can autofill downward, by highlighting the range to develeop that pattern to autofill, but instead of manually dragging (which I think you are trying to elimeinate) you can simple click the bottom right corner of the range of cell(s) when the cursor changes to plus and double click. This will always do the autofill downward to the rows with any data in adjacent cells and then stop....

[yinyang] Tranpkp [pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top