This macro is intended to via an Inputbox using Findstring, find a row, copy it to the first empty row of a different worksheet, and delete the row on the original worksheet.
If Not Rng Is Nothing Then
Rng.EntireRow.Copy
Worksheets("ScrapLogboek").Cells(Rows.Count, "A").End(xlUp).Offset(1, -1)
Worksheets("ScrapLogboek").Range("A2").PasteSpecial
Rng.EntireRow.Delete
Else
MsgBox ("Niks gescrapt. Check of het B-nummer correct is.")
End If
End With
MsgBox ("Logboek gescrapt.")
End If
End Sub
I get a syntax error on the Offset function.
Worksheets("ScrapLogboek").Cells(Rows.Count, "A").End(xlUp).Offset(1, -1).
End WithandEnd Ifwith no starting condition. Which line is it failing on? What is wrong?