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: 40
Default Need Help on Define Names

Hello all,

I have 3 defined names (Sheet1!DefineName1, Sheet1!DefineName2 and 'Sheet
2'!DefineName3) in two worksheets of my Excel file.

I need help with writing a code to execute if one of the 3 above defined
names is not in the workbook, message the users that please use another
template. Else execute the rest of code.

Below is the code that I currently have, and it's not working.

if activeworkbook.name<"DefineName1" or activeworkbook.name<"DefineName2"
or activeworkbook.name<"'Sheet 2'!DefineName3" then
msgbox "Please use another template.",vbinformation
else
execute the rest of code
end if

Based on the above code, even if I have all three define names in the
workbook, the message comes up and it does not execute the rest of code. The
message should not come up and the code should execute the rest of code if
all three define names are in the workbook.

Thanks.
 
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
Questions on Define Names AccessHelp Excel Discussion (Misc queries) 3 November 10th 08 03:43 PM
Capturing Define Names Bret Excel Programming 8 October 18th 07 10:11 PM
Define Names in Excel Dave T at home Excel Discussion (Misc queries) 2 November 1st 05 03:27 PM
how to define range names anton New Users to Excel 1 October 14th 05 08:28 AM
alternate UI for Define Names ?? jmg092548 Excel Discussion (Misc queries) 2 August 11th 05 01:32 PM


All times are GMT +1. The time now is 07:44 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"