Here is a report that I need to run. I can get the first part number to run, but now I need to increment myrange and rsearch. I need it to keep the same part number and ID number on the same row and when the part number changes, it is placed on a new row. Any suggestions.
Part Number ID Number WSH TP ROLL HT Ship
11588715 1428 X X
'Output into destination sheet
p = p + 1
m = p + 1
Do
Set myrange = Sheets(sh).Range(TestRange3)
Set rsearch = Sheets(destsh).Range(output(13))
If myrange = rsearch Then
vRet = Application.WorksheetFunction.VLookup(myrange, Worksheets("data").Range("A2:G300"), 2, False)
reportlocation = "A" + m 'partnumber
Sheets(destsh).Range(reportlocation) = vRet
If UCase(Trim(Sheets(sh).Range(TestRange))) = UCase(Trim(Sheets(destsh).Range(output(13)))) Then 'WSH
reportlocation = "C" + m 'X WSH
Sheets(destsh).Range(reportlocation) = strvar1
ElseIf UCase(Trim(Sheets(sh).Range(TestRange))) = UCase(Trim(Sheets(destsh).Range(output(5)))) Then 'ROLL
reportlocation = "E" + m 'X ROLL
Sheets(destsh).Range(reportlocation) = strvar1
ElseIf UCase(Trim(Sheets(sh).Range(TestRange))) = UCase(Trim(Sheets(destsh).Range(output(9)))) Then 't/p
reportlocation = "D" + m 'X TP
Sheets(destsh).Range(reportlocation) = strvar1
ElseIf UCase(Trim(Sheets(sh).Range(TestRange))) = UCase(Trim(Sheets(destsh).Range(output(7)))) Then 'HT
reportlocation = "F" + m 'X HT
Sheets(destsh).Range(reportlocation) = strvar1
ElseIf UCase(Trim(Sheets(sh).Range(TestRange))) = UCase(Trim(Sheets(destsh).Range(output(11)))) Then 'Ship
reportlocation = "G" + m 'X SHIP
Sheets(destsh).Range(reportlocation) = strvar1
End If
End If
n = n + 1
TestRange3 = "A" + n
TestRange = "E" + n
output(1) = "A" + n
output(13) = "B" + n
Loop Until Sheets(destsh).Range(output(13)) =
Part Number ID Number WSH TP ROLL HT Ship
11588715 1428 X X
'Output into destination sheet
p = p + 1
m = p + 1
Do
Set myrange = Sheets(sh).Range(TestRange3)
Set rsearch = Sheets(destsh).Range(output(13))
If myrange = rsearch Then
vRet = Application.WorksheetFunction.VLookup(myrange, Worksheets("data").Range("A2:G300"), 2, False)
reportlocation = "A" + m 'partnumber
Sheets(destsh).Range(reportlocation) = vRet
If UCase(Trim(Sheets(sh).Range(TestRange))) = UCase(Trim(Sheets(destsh).Range(output(13)))) Then 'WSH
reportlocation = "C" + m 'X WSH
Sheets(destsh).Range(reportlocation) = strvar1
ElseIf UCase(Trim(Sheets(sh).Range(TestRange))) = UCase(Trim(Sheets(destsh).Range(output(5)))) Then 'ROLL
reportlocation = "E" + m 'X ROLL
Sheets(destsh).Range(reportlocation) = strvar1
ElseIf UCase(Trim(Sheets(sh).Range(TestRange))) = UCase(Trim(Sheets(destsh).Range(output(9)))) Then 't/p
reportlocation = "D" + m 'X TP
Sheets(destsh).Range(reportlocation) = strvar1
ElseIf UCase(Trim(Sheets(sh).Range(TestRange))) = UCase(Trim(Sheets(destsh).Range(output(7)))) Then 'HT
reportlocation = "F" + m 'X HT
Sheets(destsh).Range(reportlocation) = strvar1
ElseIf UCase(Trim(Sheets(sh).Range(TestRange))) = UCase(Trim(Sheets(destsh).Range(output(11)))) Then 'Ship
reportlocation = "G" + m 'X SHIP
Sheets(destsh).Range(reportlocation) = strvar1
End If
End If
n = n + 1
TestRange3 = "A" + n
TestRange = "E" + n
output(1) = "A" + n
output(13) = "B" + n
Loop Until Sheets(destsh).Range(output(13)) =