H
Hennie Neuhoff
Hi. All,
I've been using this code for some time without any problems, suddenly I get
this run time error - Object variable or With block variable not set.
Appreciate your help!
Thank you
Public Sub KryShtBld()
Dim MatchSht, sht As Object
For Each sht In Sheets
If sht.Range("D1") = Range("bladsoek").Value Then
Set MatchSht = sht
Exit For
End If
Next sht
With MatchSht
sht.Activate <------------- Error here
End With
Exit Sub
End Sub
I've been using this code for some time without any problems, suddenly I get
this run time error - Object variable or With block variable not set.
Appreciate your help!
Thank you
Public Sub KryShtBld()
Dim MatchSht, sht As Object
For Each sht In Sheets
If sht.Range("D1") = Range("bladsoek").Value Then
Set MatchSht = sht
Exit For
End If
Next sht
With MatchSht
sht.Activate <------------- Error here
End With
Exit Sub
End Sub