I have done this before in 2007 but having problems getting it to work in 2010. I am doing some work that involves copyinging multiple columns. For example i would like to take copy A1:1000 from one workbook to, say, D1:D1000 in a new workbook.
Here is an example of the macro I used when I still had 2007:
Sub COPYCELL()
Dim wbk As Workbook
strFirstFile = "C:\Users\NAME\Desktop\Test\Test1.xlsm"
strSecondFile = "C:\Users\NAME\Desktop\Test\Test2.xlsm"
Set wbk = Workbooks.Open(strFirstFile)
With wbk.Sheets("Sheet1")
.Range("A1:A1000").Copy
End With
Set wbk = Workbooks.Open(strSecondFile)
With wbk.Sheets("Sheet2")
.Range("D1:D1000").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
End With
End Sub
For some reason it wont open the new workbook like it did before to paste the information from the original workbook.
Any help would be appreciated. Thanks!
Bookmarks