Please proof read me code.
it works, but it seems to miss over half the data I need to extract.
Strange.
Sub trial()
x = 1
y = 2
lr = Sheets("charge report").Cells(Rows.Count, "A").End(xlUp).Row
Do Until x > lr
Do Until Left(Sheets("charge report").Cells(x, 10), 1) = "S" AndLen(Sheets("charge report").Cells(x, 10)) = 7 Or x > lr
x = x + 1
Loop
invoice = (Sheets("charge report").Cells(x, 10)) & (Sheets("charge report").Cells(x, 11))
'MsgBox ("Your Invoice number is ") & invoice
Do Until Left(Sheets("charge report").Cells(x, 11), 1) = "Q" Or x > lr
x = x + 1
Loop
'MsgBox x
Row = x
pcode = (Sheets("charge report").Cells(x, 3))
desc = (Sheets("charge report").Cells(x, 4))
lot# = (Sheets("charge report").Cells(x + 1, 9))
chcode = (Sheets("charge report").Cells(x, 11))
'MsgBox Row
'MsgBox pcode
'MsgBox desc
'MsgBox lot#
'MsgBox chcode
'Paste Extracted Data into "Data" Sheet
Sheets("data").Cells(y, 1) = invoice
Sheets("data").Cells(y, 2) = Row
Sheets("data").Cells(y, 3) = pcode
Sheets("data").Cells(y, 4) = desc
Sheets("data").Cells(y, 5) = lot#
Sheets("data").Cells(y, 6) = chcode
x = x + 1
y = y + 1
Loop
it works, but it seems to miss over half the data I need to extract.
Strange.
Sub trial()
x = 1
y = 2
lr = Sheets("charge report").Cells(Rows.Count, "A").End(xlUp).Row
Do Until x > lr
Do Until Left(Sheets("charge report").Cells(x, 10), 1) = "S" AndLen(Sheets("charge report").Cells(x, 10)) = 7 Or x > lr
x = x + 1
Loop
invoice = (Sheets("charge report").Cells(x, 10)) & (Sheets("charge report").Cells(x, 11))
'MsgBox ("Your Invoice number is ") & invoice
Do Until Left(Sheets("charge report").Cells(x, 11), 1) = "Q" Or x > lr
x = x + 1
Loop
'MsgBox x
Row = x
pcode = (Sheets("charge report").Cells(x, 3))
desc = (Sheets("charge report").Cells(x, 4))
lot# = (Sheets("charge report").Cells(x + 1, 9))
chcode = (Sheets("charge report").Cells(x, 11))
'MsgBox Row
'MsgBox pcode
'MsgBox desc
'MsgBox lot#
'MsgBox chcode
'Paste Extracted Data into "Data" Sheet
Sheets("data").Cells(y, 1) = invoice
Sheets("data").Cells(y, 2) = Row
Sheets("data").Cells(y, 3) = pcode
Sheets("data").Cells(y, 4) = desc
Sheets("data").Cells(y, 5) = lot#
Sheets("data").Cells(y, 6) = chcode
x = x + 1
y = y + 1
Loop