Hello, I have an existing macro that will work to parse the data shown. This can be found here http://www.excelforum.com/excel-prog...-new-post.htmlI was wondering if it was possible to multiply the sku in worksheet 2 by the number that is above the SKU in worksheet one. This is the quantity the customer ordered. So for example below it shows product A as being purchased once and product B as being purchased twice. The quantity is in the cell right above the SKU. The result I want is below that~
Quantity Product Details Price
1 Product A
SKU: 7Z-36Q9-LK1P
ASIN: B009BTQ8S4
Listing ID: 0916M1DMLSL
Order-Item ID: 28255029918234
Condition: New $14.99 Subtotal:
Shipping: $3.66
________________________________________
Total: $18.65
2 Product B
SKU: QP-PQXS-3CA8
ASIN: B009FRAVUS
Listing ID: 0924M9480RX
Order-Item ID: 63126777937842
Condition: New $12.99 Subtotal:
Shipping: $6.34
________________________________________
Total: $32.32
ORDER TOTAL: $50.97
So worksheet 2 would look like this
7Z-36Q9-LK1P Product A
QP-PQXS-3CA8 Product B
QP-PQXS-3CA8 Product B
You can see since the item was purchased twice the SKU would show twice and give me a truer count. I would assume since the data is being multiplied by a set number given from within the data, it shouldn't be hard to integrate into the already great macro. I do appreciate everyone's help and look forward to hearing if its possible or not. Below is the macro code. Thanks again!
![]()
Sub GetSKU() Dim w1 As Worksheet Dim w2 As Worksheet Set w1 = Sheets("Sheet1") Set w2 = Sheets("Sheet2") Dim lr As Long lr = w1.Range("A" & Rows.Count).End(xlUp).Row Dim lr2 As Long Dim i As Long Dim L As Long Dim S As String Application.ScreenUpdating = False For i = 1 To lr lr2 = w2.Range("A" & Rows.Count).End(xlUp).Row If Left(w1.Range("A" & i), 4) = "SKU:" Then L = Len(w1.Range("A" & i)) - 5 w2.Range("A" & lr2 + 1) = Right(w1.Range("A" & i), L) w1.Range("A" & i).Offset(-1, 1).Copy w2.Range("B" & lr2 + 1) End If Next i Application.CutCopyMode = False Application.ScreenUpdating = True MsgBox ("Task Completed") End Sub
Bookmarks