I'm trying to create a work tool that will allow orders to be built in Excel line by line to be imported into NetSuite as a CSV file. Most of the order information is on one line from cells A2 to AB2 (with A1 to AB1 being headers), but the variability comes from the fact that the line items that are the physical items to be shipped as part of the order have to be stacked vertically in column Z, and linked together as one order by a unique ID in column A. Here is an excerpt from the NetSuite CSV Import Guide to show what I mean:
Attachment 631876
So the process would be to manually build one full order (e.g. date to ship, shipping location etc), stack the line items to be included in column Z and their quantities in column AA (in most cases each batch of shipments will be the same number of items just being sent to different places), and then have a macro select that one full order range (so for example, if my template order was sending 5 items, it would need to copy a range from A2:AB6, but it could also be 10 items and need to be A2:AB11), and copy it down a variable number of times. The amount of times that the one block order template (e.g. A2:AB6) needs to be repeated would be dictated by the number of sites that this type of order needs to be sent to, which would be listed in a different tab.
So the user will populate their basic order information in fields A2:AB2, stack their line items in Z2:Z#, paste their list of site references into the 'Site List' tab (e.g. site 100 in A1, site 101 in A2, site 102 in A3), click a macro button and the macro would copy the variable cell range (A2:AB#) dictated by the amount of rows in column Z (not including the header Z1), and then copy that block of rows and paste it down a number of times based on the number of rows with data in column A of the 'Site List' tab.
The last piece of the puzzle would then be to get those site references (100, 101, 102) into the cell in column U for each "order" (block of rows), because these site numbers are a necessary field for each order as this dictates the different final destinations for each order. So in the example with 5 line items and 3 sites, A1 from the 'Site List' tab (100) would need to be input to U2 on the 'Orders' tab, A2 (101) would need to map to U7, A3 (102) would need to map to U12 (separated by the amount of line items in Z2:Z#, 5 in this example).
I am capable of performing these functions myself just with copy/paste trickery, however I am creating this tool for a team that has no Excel expertise at all, and to get them using the tool I need to make it as easy to use as possible.
I've spent weeks staring at this problem, and every time I think I've found VBA code for a solution, it doesn't work for reasons that I can't figure out because of my lack of VBA expertise. Any help would be greatly appreciated.
Bookmarks