Peter Thompson
Active Member
- Joined
- Dec 15, 2008
- Messages
- 262
Hello,
I am getting a run-time error and I dont understand the reason why. The error occurs at the point "Selection.paste" , which I have bolded. I don't understand why it is failing as it has copied the data and selected the correct cell. This is driving me mad, please help!
Sub import2()
Worksheets("WWBDALL").Select
Range("b2").Value = FileDateTime("S:\Logistic\2. Demand and Capacity Planning\Lifestyle Demand - MK\Drops & Selects\Downloads\wwbdall.csv")
If Range("B1") < Range("B2") Then
Workbooks.Open Filename:= _
"S:\Logistic\2. Demand and Capacity Planning\Lifestyle Demand - MK\Drops & Selects\Downloads\wwbdall.csv"
Range("A1:J60000").Select
Selection.Copy
Windows("WWBSALL Master.xls").Activate
Range("A5").Select
Selection.Paste
Range("a5").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete
Range("a5").Select
Else
End If
End Sub
I am getting a run-time error and I dont understand the reason why. The error occurs at the point "Selection.paste" , which I have bolded. I don't understand why it is failing as it has copied the data and selected the correct cell. This is driving me mad, please help!
Sub import2()
Worksheets("WWBDALL").Select
Range("b2").Value = FileDateTime("S:\Logistic\2. Demand and Capacity Planning\Lifestyle Demand - MK\Drops & Selects\Downloads\wwbdall.csv")
If Range("B1") < Range("B2") Then
Workbooks.Open Filename:= _
"S:\Logistic\2. Demand and Capacity Planning\Lifestyle Demand - MK\Drops & Selects\Downloads\wwbdall.csv"
Range("A1:J60000").Select
Selection.Copy
Windows("WWBSALL Master.xls").Activate
Range("A5").Select
Selection.Paste
Range("a5").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete
Range("a5").Select
Else
End If
End Sub