ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Past formula to the end (https://www.excelbanter.com/excel-programming/292832-past-formula-end.html)

Duncan J

Past formula to the end
 
If I have spreadsheet that changes in row size and want to copy formula from column K2 and past the formula to the last row. Despite sometimes it ends at 1303 or 1500
Thanks
D


Duncan J

Figured it out
 
Thanks, got it to work
Dim LastRow As Lon
Dim LastCol As Lon
Dim rng As Rang

With ActiveShee
Set rng = .UsedRange 'try to reset lastused cel
With rn
LastRow = .Rows(.Rows.Count).Ro
LastCol = .Columns(.Columns.Count).Colum
End Wit

.Range("K2").AutoFill
Destination:=.Range("K2:K" & LastRow), Type:=xlFillDefaul

End Wit



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com