Code to copy cells from multiple worksheets

  • Thread starter Thread starter Chad Somerset
  • Start date Start date
C

Chad Somerset

I have a workbook that has about 100 sheets. I need to
copy cells c5, e5, and m5 from each sheet into a summary
sheet. Can anyone provide me with a macro or point me
where to look for the correct code that will automate this
process? I expect that I will be adding about 50
additional sheets before I am done.

Thanks.
 
Hi Chad
This code will copy cells C5, E5, and M5 from each sheet of your workbook
(starting from sheet 2) into the first sheet (to col A, B & C, starting in
row1).
If you want to start copying in row 2 of your summary sheet, set j =2
=======
Sub CopyCellsToSheet1()
Application.ScreenUpdating = False
Dim i As Integer
Dim j As integer
j = 1
For i = 2 To Sheets.Count
Sheets(i).Activate
Union([C5], [E5], [M5]).Copy Destination:=Sheets(1).Range("A" & j)
j = j + 1
Next i
Sheets(1).Activate
Application.ScreenUpdating = True
End Sub
=======
Hope it helps!
Lydya
 
Back
Top