I have the following code:
Sub CheckDates()
bAlarm = False
i = 1
Do Until ActiveSheet.Cells(row_header, i).Value = ""
If ActiveSheet.Cells(row_header, i).Value = searchText Then
col = i
Exit Do
End If
i = i + 1
Loop
i = 1
Do Until ActiveSheet.Cells(row_header, i).Value = ""
If ActiveSheet.Cells(row_header, i).Value = searchNameText Then
col_name = i
Exit Do
End If
i = i + 1
Loop
If col = 0 Then
MsgBox searchText & " basliklar arasinda bulunamadi"
Exit Sub
Else
N = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
For i = row_header + 1 To N
If isInDateRange(ActiveSheet.Cells(i, col).Value) Then
With UserForm1.ListBox1
.AddItem
.List(.ListCount - 1, 0) = ActiveSheet.Cells(i, col_name).Value
.List(.ListCount - 1, 1) = ActiveSheet.Cells(i, col).Value
End With
bAlarm = True
End If
Next i
End If
If bAlarm = True Then
UserForm1.Show
End If
I am getting the Object variable or With block variable not set (Error 91) error on the line with Do Until ActiveSheet.Cells(row_header, i).Value = "". When I debug I can see that hprlink.Range does have a value. Any thoughts what I'm doing wrong?