![]() |
Autofill Macro for 2 rows and 100 columns
Hi,
I'm trying to correct a macro that autofills the formulae held in cells A1 and A2 and fills all the way along to CZ2. This is what I have already. With Worksheets("For Report") .Range("A" & CStr(prev_points + 1)).AutoFill _ Destination:=.Range("A" & CStr(prev_points + 1) & ":A" & _ CStr(100 + 1)), Type:=xlFillDefault End With It runs, but it's filling vertical instead of horizontal. I've tried changing the range from A to 1 so that it does the row instead of the column, but the sub won't run when I change it. Any ideas how I can: (a) get this to fill along the row instead of down the column. (b) get it to include row 2 as well as row 1. Any help would be brilliant! Thanks D |
Autofill Macro for 2 rows and 100 columns
Hi Donnie,
Try: With Worksheets("For Report") .Range("A" & CStr(prev_points + 1)).Resize(2).AutoFill _ Destination:=.Range("A" & _ CStr(prev_points + 1)).Resize(2, 104), _ Type:=xlFillDefault End With --- Regards, Norman wrote in message oups.com... Hi, I'm trying to correct a macro that autofills the formulae held in cells A1 and A2 and fills all the way along to CZ2. This is what I have already. With Worksheets("For Report") .Range("A" & CStr(prev_points + 1)).AutoFill _ Destination:=.Range("A" & CStr(prev_points + 1) & ":A" & _ CStr(100 + 1)), Type:=xlFillDefault End With It runs, but it's filling vertical instead of horizontal. I've tried changing the range from A to 1 so that it does the row instead of the column, but the sub won't run when I change it. Any ideas how I can: (a) get this to fill along the row instead of down the column. (b) get it to include row 2 as well as row 1. Any help would be brilliant! Thanks D |
Autofill Macro for 2 rows and 100 columns
Brilliant. Works perfectly!
Thanks very much Norman. |
All times are GMT +1. The time now is 04:21 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com