Littlemalky
Board Regular
- Joined
- Jan 14, 2011
- Messages
- 223
Hey can someone help me out with perfecting this line of code because I continue to get the error, "Subscript out of range", and I'm not sure what I'm doing wrong. I'm assuming that this code isn't exactly synonymous with the actual file name, but I don't know how to correct it.
One workbook that I'm copying the data from is called "detail w add.xlsx". The workbook that I'm pasting into is called, "Fullfillment 20110301 - Domestic.xlsx". The numbers will always be the current day's date formatted yyyymmdd. Can anyone help?
One workbook that I'm copying the data from is called "detail w add.xlsx". The workbook that I'm pasting into is called, "Fullfillment 20110301 - Domestic.xlsx". The numbers will always be the current day's date formatted yyyymmdd. Can anyone help?
Code:
Sub DetailWAdd()
Workbooks("detail w add.xlsx").Cells.Copy _
[COLOR=red] Destination:=Workbooks("Fulfillment " & Format(Date, "yyyymmdd") & "- Domestic" & ".xlsx").Worksheets("detail w add").Range("A1")
[/COLOR] Application.CutCopyMode = False
Workbooks("detail w add.xlsx").Close SaveChanges:=False 'Closes without saving changes
End Sub