I have an Excel workbook with many sheets. Each sheet is labeled by month & year. i.e. January 2019, and so on, except for the first and second sheet.
The first sheet is hidden (not doing anything there). The second sheet is named Sales Chart (where I want to paste the data). The rest are the month & year sheets.
I need to copy cells B5:B10 on all current month & year sheets, and also any future sheets (which will follow the month & year pattern). After copying the data, it should paste horizontally (the first sheets info being pasted on row B31, the second on row B32, etc.).
I am using a code I found online. It only copies one sheet. It copies the formulas, instead of the formula results. It copies vertically then pastes vertically, instead of copying vertically then pasting horizontally.
Sub MakeSummaryTable()
Dim ws As Worksheet
Application.ScreenUpdating = True
Sheets(1).Activate
For Each ws In Worksheets
If ws.Name <> "Sales Chart" Then
ws.Range("B5:B10").Copy
ActiveSheet.Paste Range("B31").End(xlUp).Offset(1, 0)
End If
Next ws
Application.ScreenUpdating = True
End Sub
I expect the code to copy the results on cells B5:B10 from all current sheets and paste it to sheet "Sales Chart" B31-G31 (horizontally) and downwards.