Hello,
I'm having a bit of trouble fixing an issue I'm having and not having much luck googling the problem. I have a loop that searches for certain things. What I'm trying to do is have the row that the search is positive for print the value from Column A of that row into another sheet. I cannot, however, figure out how to do this. Please see below for my latest try, it's having issues at "Range(nextrow).Value = cell.Offset(0, -19).Value"
I'm having a bit of trouble fixing an issue I'm having and not having much luck googling the problem. I have a loop that searches for certain things. What I'm trying to do is have the row that the search is positive for print the value from Column A of that row into another sheet. I cannot, however, figure out how to do this. Please see below for my latest try, it's having issues at "Range(nextrow).Value = cell.Offset(0, -19).Value"
Code:
Sub checkpiececount()
Dim nextrow As Long
For Each cell In Range("T77:T580")
If cell.Value <> 0 Then
If cell.Offset(0, -12).Value = 0 Then
MsgBox "No Piece Count for SKU# " & cell.Offset(0, -19).Value
nextrow = Sheet2.Cells(Rows.Count, "A").End(xlUp).Row + 1
Range(nextrow).Value = cell.Offset(0, -19).Value
End If
End If
Next cell
Sheet2.Select
End Sub