I have a worksheet that I have recorded my customers on. Each row is for a different customer. I offer a variety of products stored as columns in this worksheet. The customers can order any combination of these products. I am recording how many of each item they buy on the same row as their customer info. In another tab I have a table of the products with added details such as the sell price, UOM, SKU, etc. I am trying to figure out how to create a loop that will go row by row, look across the product columns (set as For i = 15 to 53) and if it finds the customer ordered that product record the quantity ordered and and product description, stored as the column header, in a template on a different sheet. The other sheets uses this info to pull the added details from my table to create a complete invoice.
The piece I have below is just a snippit of this but I'm having trouble getting the loop to work the way I'd like after copying the column header and pasting it on another sheet. I thought I had written it correctly to go back to the last active cell on the "Multi" worksheet. However, it keeps going to the first customer row, first product column. It is the movement, not the actions that are not working for me.
Any suggestions would be appreciated.
Dim curSpot As String
Sheets("Multi").Activate
Range("A2").Select
Do Until IsEmpty(ActiveCell)
For i = 15 To 17
Rows(ActiveCell.Row).Columns(i).Select
If (ActiveCell) >= 1 Then Cells(1, ActiveCell.Column).Copy
curSpot = ActiveCell
Sheets("Item-Packing Detail").Select
' This is where I will put the paste function once I have proof of concept worked out with the movement
Application.Goto Reference:=("curSpot")
Next i
Cells(ActiveCell.Row, 1).Select
ActiveCell.Offset(1, 0).Select
Loop
End Sub
The piece I have below is just a snippit of this but I'm having trouble getting the loop to work the way I'd like after copying the column header and pasting it on another sheet. I thought I had written it correctly to go back to the last active cell on the "Multi" worksheet. However, it keeps going to the first customer row, first product column. It is the movement, not the actions that are not working for me.
Any suggestions would be appreciated.
Dim curSpot As String
Sheets("Multi").Activate
Range("A2").Select
Do Until IsEmpty(ActiveCell)
For i = 15 To 17
Rows(ActiveCell.Row).Columns(i).Select
If (ActiveCell) >= 1 Then Cells(1, ActiveCell.Column).Copy
curSpot = ActiveCell
Sheets("Item-Packing Detail").Select
' This is where I will put the paste function once I have proof of concept worked out with the movement
Application.Goto Reference:=("curSpot")
Next i
Cells(ActiveCell.Row, 1).Select
ActiveCell.Offset(1, 0).Select
Loop
End Sub