Question: Sub buildSKUdata() Dim Row As Long Dim origData As Range Dim newWs As Worksheet Dim newRow As Range '1.0) Initialize Set origData = Application.InputBox(Select a
Sub buildSKUdata() Dim Row As Long Dim origData As Range Dim newWs As Worksheet Dim newRow As Range
'1.0) Initialize
Set origData = Application.InputBox("Select a range", "Obtain Range Object", Type:=8)
For Row = 2 To origData.Rows.Count If hasaSKU(origData.Cells(Row, 1)) Then Call writeNewRow(newWs, newRow, origData.Rows(Row)) newRow = newRow + 1 End If Next Row End Sub
Sub writeNewRow(newWs As Worksheet, ByVal newRow As Long, OrigRow As Range) Call buildSKUdata(origRow.Cells(1,1),Sku,descr)newWs.Cells(newRow,1) = SKU newWs.Cells(newRow, 2) = decr Range(bigData.Cells(1, 2), bigData.Cells(1, 9)).Copy newWs.Cells(newRow, 3)
End Sub
I cant figure out why this VBA code won't work
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
