I am receiving an object variable error when I run a Macro.
Object Variable or with block variable not set
This occurs on the second time I run the Macro through. Here is the code that is causing the error:
' Select the first Junk Row and use it to delete all rows afterward
With ActiveSheet
LastRow = .Cells(.Rows.Count, "F").End(xlUp).Row
End With
With Columns("F")
.Find(What:="Total", After:=.Cells(1, 1), LookIn:=xlValues).Activate - **Error occurs here.**
End With
A = ActiveCell.Row
Range(A & ":" & LastRow).Delete
Any suggestions would be greatly appreciated. If I shut the program down it works fine the next time through.
Thanks, Scott
Find()didn't find a match....FindargumentLookAtis by default set toxlPartso if there really isTotalin there, even if you have trailing or leading spaces, it will find it.