Hugopellegrini
Board Regular
- Joined
- Aug 14, 2012
- Messages
- 53
Hi guys,
While trying to write a macro copy pasting data from one workbook to another, I get this error :
"object does not support this property or method"
I can see that it copies the data, but it can't seem to paste it.
Here's my code
where wksNew is previously defined in the macro (Set wksNew = Worksheets.Add(after:=Sheets(5)) wksNew.Name = sBASE_NAME & sDateName)
Do you see what can be wrong?
Thanks a lot!
While trying to write a macro copy pasting data from one workbook to another, I get this error :
"object does not support this property or method"
I can see that it copies the data, but it can't seem to paste it.
Here's my code
Code:
Workbooks.Open Filename:="F:\Daily updates\Test Macro\" & Filename
Set sourceSheet = Workbooks(Filename).Worksheets("Deals")
sourceSheet.Activate
sourceSheet.Range("B2:BA1000").Select
Selection.Copy
Set destSheet = Workbooks("Macro WIP.xls").wksNew
destSheet.Activate
destSheet.Cells.Select
destSheet.Paste
End Sub
where wksNew is previously defined in the macro (Set wksNew = Worksheets.Add(after:=Sheets(5)) wksNew.Name = sBASE_NAME & sDateName)
Do you see what can be wrong?
Thanks a lot!