Nope same error as before. There must be something wierd going on.
![]()
Workbooks.Open Filename:=sPath2 & SFileInp2 With ActiveSheet .Range("A1").Paste .Name = "105_12_31_2009_version1"
Nope same error as before. There must be something wierd going on.
![]()
Workbooks.Open Filename:=sPath2 & SFileInp2 With ActiveSheet .Range("A1").Paste .Name = "105_12_31_2009_version1"
I'm with you on that one. Can you upload a sample workbook. Have been in the pub for the last 4 days practically so I might be missing the obvious...
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
There is no Paste method for a range; it's ActiveSheet.Paste or Range.PasteSpecial
![]()
Workbooks.Open Filename:=sPath2 & SFileInp2 With ActiveSheet .Range("A1").PasteSpecial
Entia non sunt multiplicanda sine necessitate
Doh! Think I might log off for the rest of the day to save further embarrassment...
Dom
The following snippet works also:
Anyother suggestions for tightning up the code?![]()
Workbooks.Open Filename:=sPath2 & SFileInp2 With ActiveSheet .Paste Destination:=Range("A1")
One tip would be instead of using Copy...PasteSpecialValues you can just write directly like this:
![]()
Sheets ("Sheet1"), Range("A1:AV50000").Value = Sheets("Sheet2").Range("A1:AV50000").Value
I would also maybe define your workbooks as objects, makes it easier to deal with when you are working with multiple workbooks.
Dom.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks