LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 852
Default Placing the MsgBox "No ID found" statement in my code??

On Monday, May 5, 2014 10:30:02 PM UTC-7, GS wrote:
Use a boolean 'flag' to let your code know whether an ID was found or

not...



Dim bFoundID As Boolean



..and add it to the part of code that finds an ID...



...<snip

If Not Rng Is Nothing Then

bFoundID = True: MsgBox Rng.Address & " " & ws.Name

End If



..and just check its value...



...<snip

Next ws

If Not bFoundID Then MsgBox "Not found"

End Sub



--

Garry



That worked well.

Thanks, Garry
 
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
Need IF statement to categorize time into "Morning", "Afternoon", "Evening" JFire Excel Discussion (Misc queries) 2 June 7th 13 12:59 PM
Help with setting a "not found" statement Pierre Excel Discussion (Misc queries) 2 April 21st 10 02:53 AM
Help with setting a "nof found" statement Pierre Excel Discussion (Misc queries) 1 April 20th 10 11:37 PM
Getting "compile error" "method or data member not found" on reinstall Bp Excel Programming 1 April 23rd 04 04:42 PM


All times are GMT +1. The time now is 10:02 AM.

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"