I'm trying to find the row that has "Net Due:" in it and then find the last column in that row with data (not the first empty row, as you could have empty rows and then data) and then highlight that range.
I got the below to work on a test sheet but has an error on the actual ones I need it on and I can't figure out why I'm getting the following error on 'LastCol =' row, Run-time error '91': Object variable or With block variable not set
I'm sure it's something silly but I've spent too long staring at it, thanks in advance!
Dim FindRow As Range
Dim LastCol As Long
Set FindRow = Range("A:A").Find(What:="Net Due:", LookIn:=xlValues)
LastCol = Cells(FindRow.Row, Columns.Count).End(xlToLeft).Column
Range(Cells(FindRow.Row, 1), Cells(FindRow.Row, LastCol)).Select
With Selection.Interior
.Color = 5296274
End With
Bookmarks