Can anybody help me with my code, I am trying to copy data from one workbook to another using this code;
Dim wbCopy As Workbook
Dim wsCopy As Worksheet
Dim rngCopy As Range
Dim wbPaste As Workbook
Dim wsPaste As Worksheet
Dim rngPaste As Range
Set wbPaste = ActiveWorkbook
Set wbCopy = Workbooks.Open("C:\Users\vmhost\Desktop\Sheet.xlsm") 'change path
Set wsCopy = wbCopy.Worksheets("Call Details")
Set rngCopy = wsCopy.Range("a5:aa5").EntireColumn
Set wsPaste = wbPaste.Worksheets("Sheet2") 'paste to different sheet if needed
Set rngPaste = wsPaste.Range("a1") 'change this if needed
rngCopy.Copy
rngPaste.PasteSpecial
Workbooks.Application.CutCopyMode = False
Workbooks("C:\Users\vmhost\Desktop\Sheet.xlsm").Close False
End Sub
The code stops at the rngPaste.PasteSpecial Line
any ideas?
Secondly, any ideas how I could copy only certain columns into a third sheet?
Thanks
Gary
Bookmarks