ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Autofill across columns (https://www.excelbanter.com/excel-programming/298697-re-autofill-across-columns.html)

Tom Ogilvy

Autofill across columns
 
set rng = Activesheet.UsedRange
lastCol = rng.columns(rng.columns.count).Column
Range(C21,Cells(21,lastcol)).Formula = Range("B21").formula

--
Regards,
Tom Ogilvy

"Willy" wrote in message
...
Hello All!
I'm looking for the code that would allow me to autofill a formula from

the first column all the way to the last column.
The number of columns in the sheet changes every time. I will be placing

the formula in cell B21, and I want to
autofill it across to the last column. Any help would be greatly

apprieciated. Thanks in advance for your time and help!
Willy





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

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