Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Vick
 
Posts: n/a
Default If a worksheet name is = to test then a msgbox appears

I'm looking for a macro that will display a msgbox if a worksheet is = to test.

For example, if the name of a sheet in a workbook is equal to test then
display msgbox saying sheet already exists.

Thanks

Vick
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default If a worksheet name is = to test then a msgbox appears

dim ws as worksheet
set ws = nothing
on error resume next
set ws = worksheets("test")
on error goto 0

if ws is nothing then
msgbox "doesn't exist"
else
msgbox "already exists"
end if



Vick wrote:

I'm looking for a macro that will display a msgbox if a worksheet is = to test.

For example, if the name of a sheet in a workbook is equal to test then
display msgbox saying sheet already exists.

Thanks

Vick


--

Dave Peterson
Reply
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
Using VBA to create a new worksheet, and then target new worksheet brianproctorla Excel Discussion (Misc queries) 1 September 27th 05 12:50 AM
How to protect a worksheet from being copied to another worksheet SurvivorIT Excel Discussion (Misc queries) 3 August 31st 05 01:53 PM
Copy from worksheet to another x times Union70 Excel Discussion (Misc queries) 0 March 7th 05 09:03 PM
Worksheet Function - Find? DAA Excel Worksheet Functions 2 February 24th 05 04:15 PM
Worksheet name and Backward compatibility Rich Excel Discussion (Misc queries) 3 November 30th 04 06:10 PM


All times are GMT +1. The time now is 06:49 PM.

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"