LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Run-time error 91 Object variable [2003]

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

--
HJN
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run-time error 91: Object Variable or With block variable not set Ayo Excel Programming 1 August 17th 09 11:29 PM
Run-time error `91': Object variable . . . not set Alan[_8_] Excel Programming 2 July 22nd 08 07:07 PM
Run-Time error '91': Object variable of With block variable not set jammin1911 Excel Programming 3 June 6th 06 06:36 PM
Run-time Error '91' Object Variable Not Set zero635[_11_] Excel Programming 0 February 3rd 06 06:37 PM
Run-time error '91': "Object variable or With block variable not set Mike[_92_] Excel Programming 2 December 30th 04 10:59 AM


All times are GMT +1. The time now is 01:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"