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: 213
Default For Statement

Good morning,

I have the code below, and the code works fine. However, the problem is the
code checks problem defined names and messages the user individually, and it
would not check the next defined name unless one is corrected.

For example, I have two problem defined names: "A000PPLE" and "O000RANGE".
The code would alert the user on "A000PPLE" first, and the code would not
alert the user on "O000RANGE" unless the defined name "A000PPLE" is
corrected.

Is there a way to change the code below to alert the user all the problem
defined names so that the user can write down all the problem defined names
all at once and does not have to wait for another one unless one is fixed?

Thanks.


For Each nName In ActiveWorkbook.Names
If Len(nName.Name) < 8 Then
MsgBox "Please check and correct the defined name '" & _
nName.Name & "' (" & Right(nName.RefersTo,
Len(nName.RefersTo) - 1) & "). " & _
"The defined name must have 8 characters long and must
be corrected " & _
"in order to proceed further.", vbCritical
GoTo TheEnd
End If
Next nName
GoTo NoErrors
 
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
IF statement inside a SUMIF statement.... or alternative method Sungibungi Excel Worksheet Functions 3 December 4th 09 06:22 PM
Reconcile Bank statement & Credit card statement & accounting data Bklynhyc Excel Worksheet Functions 0 October 7th 09 09:07 PM
Embedding an OR statement in an IF statement efficiently Chatnoir11 Excel Discussion (Misc queries) 4 February 2nd 09 08:12 PM
Using an IF statement, or VLOOKUP statement Tim Williams Excel Programming 0 December 8th 06 09:41 PM
appending and IF statement to an existing IF statement spence Excel Worksheet Functions 1 February 28th 06 11:00 PM


All times are GMT +1. The time now is 04:13 AM.

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

About Us

"It's about Microsoft Excel"