Autofill same cells but with multiple worksheets

rickcb

New Member
Joined
Oct 23, 2006
Messages
23
I have 52 identical worksheets (one for every week) and need to create a quick copy of each worksheets' C9:J11 cells. The autofill doesn't quite understand what I'm trying to do as it keeps referencing the same worksheet when I drag the handle across the grid.

Any shortcuts to this or will I have to do this manually ?

Thanks
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

ravishankar

Well-known Member
Joined
Feb 23, 2006
Messages
3,566
Hi
Paste the following codes in the macro window ( Alt F8)

Code:
Sheets.Add.Name = "Summary"
For a = 1 To Sheets.Count
Cells(a * 3, 1) = Worksheets.Name
For b = 3 To 10
For c = 9 To 11
Cells(a * 3 + c - 9,b) = Worksheets(a).Cells(c, b)
Next c
Next b
Next a
run the macro. It will add a sheet called summary and collates all C9 to J11 in it.
Ravi
 
Upvote 0

rickcb

New Member
Joined
Oct 23, 2006
Messages
23
Information missing

I've tried to run the macro but I get a compile error. I forgot to mention that the worksheets are all named as WK 1, WK 2, WK 3,... WK 52

Thanks
 
Upvote 0

ravishankar

Well-known Member
Joined
Feb 23, 2006
Messages
3,566
Hi
No need for sheet names in this macro. I found an error in the code I gave. The modified code is

Code:
Sheets.Add.Name = "Summary"
For a = 1 To Sheets.Count
Cells(a * 3, 1) = Worksheets(a).Name
For b = 3 To 10
For c = 9 To 11
Cells(a * 3 + c - 9, b) = Worksheets(a).Cells(c, b)
Next c
Next b
Next a
Ravi
 
Upvote 0

Forum statistics

Threads
1,191,587
Messages
5,987,510
Members
440,098
Latest member
MickyMouse123

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
Top