I am new to Excel VBA (using Excel 2007) and have been asked to create a macro to re-order a spreadsheet so that it will load into a new software package.
The workbook is a download from our website cart which shows a list of all our orders.
Here is a snapshot of the workbook (the workbook is called 'Orders.csv' but I can convert to xlsx if needed):
As you can see if the customer purchases more than one product (not qty of a product, a completely different product) it is listed across the row. The first product is starts at column H, the second from column O, the third from column V and so on.
I need the data to be displayed as follows:
So each product is listed below each other and with the same customer details before it. This is so the invoicing software can check each order ID and create an invoice accordingly showing all the different products.
I am good at formulae in Excel but, other than I believe from research that this will need to be a looping macro that checks if a row has data in a cell and then copies ranges accordingly, I have no idea how to actually go about this as I have little to no experience with coding. I have read about looping macros but cannot get my head around how it all fits together.
Ideally, if someone can help, I am looking for a macro with explanations so that I can see how it is put together as I really want to get to grips with this kind of looping macro.
The workbook is a download from our website cart which shows a list of all our orders.
Here is a snapshot of the workbook (the workbook is called 'Orders.csv' but I can convert to xlsx if needed):

As you can see if the customer purchases more than one product (not qty of a product, a completely different product) it is listed across the row. The first product is starts at column H, the second from column O, the third from column V and so on.
I need the data to be displayed as follows:

So each product is listed below each other and with the same customer details before it. This is so the invoicing software can check each order ID and create an invoice accordingly showing all the different products.
I am good at formulae in Excel but, other than I believe from research that this will need to be a looping macro that checks if a row has data in a cell and then copies ranges accordingly, I have no idea how to actually go about this as I have little to no experience with coding. I have read about looping macros but cannot get my head around how it all fits together.
Ideally, if someone can help, I am looking for a macro with explanations so that I can see how it is put together as I really want to get to grips with this kind of looping macro.
Last edited: