Hi
I am getting the runtime error 448 on the following code and can not figure out why.
Private Sub CommandButton1_Click()
Dim done As Boolean 'done with search and clearing
Dim slt As Range
Dim sltrow As Long
Dim lot As Long
Dim rmvlot As Integer
Dim asltrow As Long
Dim lookfor As String
lookfor = "LOT #"
done = False
Do While done = False
With Sheets("KRILL")
Set slt = Worksheets("KRILL").Range("a1:a1000").Find(What:=lookfor, LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByColumns, SerchDirection:=xlNext, MatchCase:=False)
sltrow = slt.Row
lot = slt.Offset(1, 0)
rmvlot = MsgBox("Remove Lot ", lot, vbQuestion + vbYesNo)
If rmvlot = vbYes Then
asltrow = sltrow + 4
Sheets("KRILL").Range(.Cells(asltrow, 4), .Cells(asltrow + 8, 10)).ClearContents
Sheets("KRILL").Range(.Cells(asltrow, 13), .Cells(asltrow + 8, 14)).ClearContents
End If
If Sheets("KRILL").Cell(asltrow + 3, 1) = "Run Total" Then done = True
End With
Loop
End Sub
I am also attaching the file so you can see the data.
My goal is delet data in cells d5 to j12 and m5 to n12. there are formulas in other cells. And only if the user is done with the data for that specific lot number.
I can not figure out what arguement I am not naming.
thanks in advance.
Bookmarks