Hello all. I have two files. One is dailyreport.xls and one is monthlyreport.xls and they are in the same folder. I want to create a macro that will copy the data in row A on dailyreport.xls into row B on monthlyreport.xls once a month when I run the code. Both workbooks can be open or closed at the time the macro is run.
I have another macro that I cobbled together from another forum posting to paste from one sheet to another, but I don't know how to make it paste into a different workbook. Here is what I have in the code for the daily report:
Set i = Sheets("March")
Set e = Sheets("Inspection")
Dim d
Dim j
d = 1
j = 2
Do Until IsEmpty(i.Range("A" & j))
If i.Range("A" & j) <> "" Then
d = d + 1
e.Rows(d).Value = i.Rows(j).Value
End If
j = j + 1
Loop
End Sub
Can i use this and change set e = to something to specify the new workbook, or is there another better way to do it?
Thanks!
I have another macro that I cobbled together from another forum posting to paste from one sheet to another, but I don't know how to make it paste into a different workbook. Here is what I have in the code for the daily report:
Set i = Sheets("March")
Set e = Sheets("Inspection")
Dim d
Dim j
d = 1
j = 2
Do Until IsEmpty(i.Range("A" & j))
If i.Range("A" & j) <> "" Then
d = d + 1
e.Rows(d).Value = i.Rows(j).Value
End If
j = j + 1
Loop
End Sub
Can i use this and change set e = to something to specify the new workbook, or is there another better way to do it?
Thanks!