GlobaLevel
asked on
vba - copy form one workbook to another doesnt work
I am try to copy a range from one workbook to another...but it is not working for me...even though not every cell will have a value....
Dim newXl As Object
Dim wbk As Workbook
Dim ws As Worksheet
Dim strCopy As String
Dim csvPath As String
Dim dcCopyBefore As String
Dim strArray As String
dcCopyBefore = "dcCopyBefore.csv"
'Create a directoriy to save new copy of CB Data to
MyPath = "C:\disputedChangesRpts"
If Dir$(MyPath, vbDirectory) = "" Then MkDir MyPath
Set newXl = Workbooks.Add
With newXl
.Title = "dcCopyBefore"
.Subject = "dcCopyBefore"
.SaveAs Filename:="C:\disputedChangesRpts\dcCopyBefore.csv"
End With
'ActiveWorkbook.Close
Workbooks("dcCopyBefore.csv").Sheets("Sheet1").Range("A6:K65000") = Workbooks("DisputedCharges - Back office interface -v15.xls").Sheets("Disputed Charges").Range("G6:Q65000")
What do you mean when you say it's not working? What is happening?
Hello GlobaLevel,
Please explain what you mean by "not working."
Regards,
Patrick
Please explain what you mean by "not working."
Regards,
Patrick
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.