trying to debug a former teammates macro (novice user myself). object is to copy a small range, formatting and all and post in the same location in multiple worksheets that match certain criteria. in this case, moving July end of month (range g6:k8) to daily breakdown worksheets (all of July sheets (07-02->08-02) in the 365 tabs workbook).
N1 is 07-02, n9 is 08-01
tabs are named 7-2, 7-3, 7-4, etc.
any help is appreciated!
N1 is 07-02, n9 is 08-01
tabs are named 7-2, 7-3, 7-4, etc.
Code:
Sub entiremonth()
Dim x As Workbook
Dim y As Workbook
Set x = ActiveWorkbook
Dim istart As Integer
Dim iend As Integer
Dim i As Integer
starttab = Range("N1")
endtab = Range("N9")
Set y = Workbooks.Open("J:test.xlsm")
Set y = ActiveWorkbook
y.Activate
i = endtab - starttab
For Each Worksheet In i
ws.Activate
x.Activate
Range("G6:g8*h6:h8*i6:i8*k6:K8").Select
Selection.Copy
y.Activate
Range("J23").Select
Selection.pastespecial Paste:=xlPasteAllUsingSourceTheme, Operation:=xlNone _
, SkipBlanks:=False, Transpose:=False
Selection.pastespecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Next Worksheet
End Sub
any help is appreciated!