sweeneytime
Board Regular
- Joined
- Aug 23, 2010
- Messages
- 183
Hi guys,
I want the macro to loop through the workbook and copy sheets that have "Income" in A5, the selection part works.
Each sheet that has "Income" should be copied to the last sheet in the "CCActuals" workbook.
I am getting error an 1004. Anybody have an ideas?
Have tried many places to find an answer and the macro recorded doesn't help on these undefined sheet matters.
Thank,
Alam
I want the macro to loop through the workbook and copy sheets that have "Income" in A5, the selection part works.
Each sheet that has "Income" should be copied to the last sheet in the "CCActuals" workbook.
I am getting error an 1004. Anybody have an ideas?
Have tried many places to find an answer and the macro recorded doesn't help on these undefined sheet matters.
Thank,
Alam
PHP:
Sub SelectCC()
Dim WS As Worksheet
'Activate Actuals WB
Windows("2009-10 Reforecast with actuals to June10 v2 Alan.xlsm").Activate
'Select sheets with "INCOME" in A5
For Each WS In ActiveWorkbook.Worksheets
If WS.Range("A5").Text = ("INCOME") Then
WS.Copy after:=Workbooks("CC Actuals.xlsm").Sheets.Count
End If
Next WS
End Sub