I'm trying to copy G38:K38 from the 7th to the 18th sheet of the source file (Tool) and paste it to the master file (30-Day).
Here are what I've tried so far, please give the newbie in VBA some advices.
Sub macro1()
Windows("Tool.xlsm").Activate
Dim j As Integer
For j = 7 To 18
Sheets(j).Select
'My first thought is to select sheet by index number,
'and set the index number as variables, but it doesn't work...
Range("G38:K38").Select
Selection.Copy
Windows("30-Day.xlsm").Activate
Sheets("SB12").Select
For k = 17 To 28
Range("E" & k).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Next k
Next j
End Sub
I've also tried this but it doesn't work either.
Sub macro2()
Windows("Tool.xlsm").Activate
If ActiveSheet.Index = Worksheets.Count Then
Worksheets(1).Select
Else
ActiveSheet.Next.Select
End If
Range("G38:K38").Select
Selection.Copy
Windows("30-Day.xlsm").Activate
Sheets("SB12").Select
For k = 17 To 28
Range("E" & k).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Next k
End Sub