Hi all
I have been through various threads on this topic, but so far haven't been able to get to a solution that accomplishes what I need. Any help would be greatly appreciated!
I have a workbook, OrderForm, with two worksheets - Order1 & OrderHistory.
Order form is structured like this:
This sheet is overwritten daily by new data that is downloaded from an external source. My goal is to record the daily order quantity and the order date on the OrderHistory sheet to maintain the historic order data. Currently this is a manual process.
At the moment I have come up with the following VBA code:
However the data from the external source will not always have all the product lines is that line is stopped, so the code above won't work for what I need.
I have tried to use INDEX MATCH but haven't been successful.
What I need is:
To copy the order quantity (column H) for the product lines in the next available column in the OrderHistory workbook. So today it copies into column C, tomorrow D, the next day column E etc etc. It also needs to copy over the order date as the column header into column C row 1, column D row 1 etc etc.
Is that achievable?
Thanks for any help that is out there!
Cheers
I have been through various threads on this topic, but so far haven't been able to get to a solution that accomplishes what I need. Any help would be greatly appreciated!
I have a workbook, OrderForm, with two worksheets - Order1 & OrderHistory.
Order form is structured like this:
This sheet is overwritten daily by new data that is downloaded from an external source. My goal is to record the daily order quantity and the order date on the OrderHistory sheet to maintain the historic order data. Currently this is a manual process.
At the moment I have come up with the following VBA code:
VBA Code:
Sub CopyPaste()
Application.ScreenUpdating = False
Dim copySheet As Worksheet
Dim pasteSheet As Worksheet
Set copySheet = Worksheets("Order1")
Set pasteSheet = Worksheets("OrderHistory")
copySheet.Range("L2").Copy
pasteSheet.Cells(1, Columns.Count).End(xlToLeft).Offset(0, 1).PasteSpecial xlPasteValues
copySheet.Range("H7:H50").Copy
pasteSheet.Cells(1, Columns.Count).End(xlToLeft).Offset(1, 0).PasteSpecial xlPasteValues
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
However the data from the external source will not always have all the product lines is that line is stopped, so the code above won't work for what I need.
I have tried to use INDEX MATCH but haven't been successful.
What I need is:
To copy the order quantity (column H) for the product lines in the next available column in the OrderHistory workbook. So today it copies into column C, tomorrow D, the next day column E etc etc. It also needs to copy over the order date as the column header into column C row 1, column D row 1 etc etc.
Is that achievable?
Thanks for any help that is out there!
Cheers