I have been using the below Macro [provided by Rgonzo1971] which finds a specific word and then deletes all rows above it, but it has now stopped working with the error Object Variable or With block Variable not set
CountrpartyRow = Cells.Find(What:="Counterparty Code", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Row
If CountrpartyRow > 1 Then
Rows("1:" & CountrpartyRow - 1).Delete
Can an Expert assist please.