Hi
I have a code that will find blank cells and copy the above cell to fill in the blank cell and it will stop when it gets to cell value containing the text "total".
But I've been getting this error " Run-time error '91': Object variable or with block variable not set"
Can you please help me fix this code o make I work
Here is the code:
Thank you
I have a code that will find blank cells and copy the above cell to fill in the blank cell and it will stop when it gets to cell value containing the text "total".
But I've been getting this error " Run-time error '91': Object variable or with block variable not set"
Can you please help me fix this code o make I work
Here is the code:
Code:
Sub FIll_in_Cells()
Dim cell As Range
Dim SearchRange As Range
On Error Resume Next
Set SearchRange = Columns("A:A").SpecialCells(xlCellTypeBlanks)
On Error GoTo 0
If cell.Value = "Total" Then
GoTo ExitLoop:
End If
On Error GoTo 0
If Not SearchRange Is Nothing Then
For Each cell In SearchRange
If cell.Row > 1 Then cell = cell.Offset(-1, 0).Value
Next cell
End If
ExitLoop:
MsgBox "Done!!!"
End Sub
Thank you