Auto Fill Macro

ctc005

New Member
Joined
Jul 20, 2007
Messages
15
I have never written a macro, but I think I can figure it out with a little help.

What I need to do is I have an area set up in my spreadsheet that has calculations (about 130 rows worth) They can all be dragged manually out to the right to fill in how large I need it. They are broked down by month (i.e. my column headers are months) I want a macro to autofill to the right based on how many years I input into G10. So if I entered 10 I want it to copy (i believe a loop is what its called?) the formulas I have in cells J11 through J130 across to the right for 10 years (120 months). Any help is appreciated. Or if I am being too vague let me know.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
No need for a loop.
Code:
With Range("J1:J130")
    .Copy .Offset(, 1).Resize(, Range("G10") * 12)
End With
 
Upvote 0
when I run it, it highlights range and tells me

Compile Error:
Invalid or unqualified reference
 
Upvote 0
had a typo, found it and corrected it, it works now, thanks sincerely for your assistance.
 
Upvote 0

Forum statistics

Threads
1,218,620
Messages
6,143,527
Members
450,493
Latest member
Woejeber

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top