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
0
Vick (9)
12/21/2005 10:06:01 PM
excel.misc 78881 articles. 5 followers. Follow

1 Replies
402 Views

Similar Articles

[PageSpeed] 18

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
0
petersod (12005)
12/21/2005 11:17:25 PM
Reply:

Similar Artilces:

Retrieving a file name quickly
In VC 6++ MFC, how do I quickly retreive the first file name (sorted ascending) from a directory? Should I be using CFileFind to get a list of file names from a directory and then sort the list? This doesn't seem to be efficent since I'm looking for one file name. >In VC 6++ MFC, how do I quickly retreive the first file name (sorted >ascending) from a directory? > >Should I be using CFileFind to get a list of file names from a directory and >then sort the list? This doesn't seem to be efficent since I'm looking for >one file name. Charles, That'...

Delete Global Customer via Worksheet 51?
RMS V 1.3, soon to be 1.3R w/ hotfix. We have way too many "John Doe" and "_ New Customer" customers in our database. All of our customer's are created as Global. I would like to delete some of these, however we have some closed locations that remain a part of our database. I understand I can issue a Worksheet Style 601: Delete Global Customers, however, under the section "This Worksheet Should Apply to...", all locations are by default, accepted. I do not like to have any unprocessed worksheets out there, so, I do not like using this method. The clos...

why does enter network password keep appearing on my screen
I have tried to change my default email from outlook express to outlook but the message box "enter network password" keeps appearing every 5 minutes on my screen. How do i stop this happening? Timm <Timm@discussions.microsoft.com> wrote: > I have tried to change my default email from outlook express to > outlook but the message box "enter network password" keeps appearing > every 5 minutes on my screen. > How do i stop this happening? What version of Outlook and what type of account(s) are listed in your mail profile? -- Brian Tillman The Outlook...

Working with multiple worksheets
This is probably very simple but i am struggling with this. I have a workbook where one sheet will be updated on a monthly basis and i want the sheet preceding it to capture its outputs. A few things i need it to capture is to check if Col B has a specific value and if yes check the value of the cell adjacent to it and count this if it is a Yes or a No. Please help! BK It sounds like VLOOKUP will work for you. Look in the help index for VLOOKUP. -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett1@austin.rr.com "Balaji K. Arige" <v_2balar@hotmail.com> w...

Mail Merge using Named Range in Excel
Having trouble completing a mail merge in Word using an Excel spreadsheet. In the spreadsheet there are named ranges, I have included the column headings by defining the range that is non-contiguous (not next to each other). When I go to complete the merge, the range will not show up as an option to use. If I re-define the range to not include the column headings and the range is a block of cells next to each other, the merge still doesn't work correctly, it assumes the merge assumes the row above the range is the column heading row (i.e. range is A16:J101, it uses row 17 as the column ...

Formula name
Hello, For the life of me, I can't figure out how to copy/paste a formula into the Name>Define>Refers To box. I've used named formulas many times but just typed the formula in. This formula is very long and complex and I just don't feel like typing it into the Refers To box. Can someone 'guide' me through this please? It's got to be simple but I'm overlooking something. TIA Sandy Sandy, copy the formula and use Ctrl v to put it in the refers to box -- Paul B Always backup your data before trying something new Using Excel 2000 & 97 Please post a...

Unable to get TextBoxes property of Worksheet Class Error
I have posted elsewhere to try and get resolution on my issue and decided to ask for help here as well. I have an issue that is driving me crazy. I have a workbook that has multiple sheets and some of these sheets have Textboxes (from the drawing tool) on the sheet with standard naming (i.e. TextBox 1, TextBox 2, etc.) I have a button that executes code that takes and builds an external file with the data from the worksheets, including the TextBoxes. During that process I am checking to see if those worksheets with TextBoxes have anything entered before attempting to grab the...

Excel
In Excel, although in Tools, Options, View, the grid lines box is checked, they don't show on my worksheet? Anyone know how to fix this? Thanks. Look in Tools, Options, View and in the color box under the gridline box, make sure it is set for automatic -- ElsiePO ----------------------------------------------------------------------- ElsiePOA's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=390 View this thread: http://www.excelforum.com/showthread.php?threadid=26183 Also Format the cells' background color to "No Color"(default) and not ...

Rule that can test for cyrillic or asian fonts?
It seems that 90% of my spam these days is in either of these fonts. Is it possible to write a rule that will put a message in a folder based on it's language or fonts? Thanks, Adam Aronson FullCity Consulting, Inc. Certified FileMaker Developer (v7 & v8) Version of Outlook? 2003/2007 can block them using the junk filter (blocked encodings option). To use a rule you need to use a rule for header contains words - look in the header for lines like this: Content-Type: text/plain; charset="windows-1252", where the charset is for the types you want to block. http://a4esl.o...

Budget Items do not appear in Monthly Budget Report
Hello, I've been using Money for nearly a decade to track account details and that has worked fine. Now, I've decided to start using the budgeting functionality and am extremely frustrated. I have items that show in the budget, but when I view the Monthly Budget report they are not included. What gives? The item is a simple mortgage payment setup as a "Loan Payment" bill from checking to the mortgage loan account. Please help! Thanks! Ian "R. Ian Lee" <RIanLee@discussions.microsoft.com> wrote in message news:C07484ED-52E3-4FA8-87EF-EB0679821972@...

Public Folder Directory Name Attribute
Can you edit the directory name attribute of a public folder in Exchange 2003? ...

Retrieving current worksheet backgroud picture
It is possible to set it using the Worksheet.SetBackgroundPicture method, but is it possible to find out what the current backgroud picture of a worksheet is? ...

Birthdays appearing as Multi-day event
I've got a problem with Birthdays in Outlook 2003. They used to appear as an all day event with the age at that birthday in brackets next to the name. Now it appears as a multi-day event. Why has this happened and how can I solve the problem? Thanks in advance. Will Will <wgodwin@gmail.com> wrote: > I've got a problem with Birthdays in Outlook 2003. They used to appear > as an all day event with the age at that birthday in brackets next to > the name. Outlook can't do that. Pocket Outlook on a Windows Mobile PDA can, however. > Now it appears as a multi-d...

Matching Names
Hi, I have a spreadsheet that contains a long list of staff names with data as follows: A B C Month Employee Name Monthly Salary From this list I want to create another 11 lists of monthly joiners and same for monthly leaversas follows: Monthly Joiners Lists: February Joiners March Joiners Employee Name Monthly Salary Employee Name Monthly Salary Under Employee Name I need a formulae that picks staff appear in February for the first time, and same applies for March, April, etc. Month...

Today data appears and DISAPPEARS!
Trying to use Outlook 2007. The Today screen comes up for about 5 seconds, then the screen is still there, but all data - appointments, tasks, etc. DISAPPEAR from the screen! I've already downloaded and installed the service pack for this program. Outlook 2003 worked great but I'm ready to ditch 2007. Any suggestions? Did you try office diagnostics? Does the outlook today page disappear too, or just the outlook data? What type of email account do you use? -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: h...

Hide worksheet when moving back to another sheet
Hello, I have a sheet called 'calculations' that I want normally to be hidden. However, there is a button on one of the sheet (called 'inputs') for the users who are interested in detail to unhide it and see it. Sub Reveal() With ThisWorkbook If Worksheets("Calculations").Visible = False Then Worksheets("Calculations").Visible = True Worksheets("Calculations").Activate End If End With End Sub I have managed to get this working by using this forum. Now, I would like to have a code that hides the sheet 'calculations' a...

how would i change default user name all excel files
I am doing a learn direct course and had to use the help facility with question; Find out how you would change the default user name for all excel files. If somebody could help please email me on georginacambridg@aol.com Tools|Options|General Tab and modify the "user name" box learner wrote: > > I am doing a learn direct course and had to use the help facility with > question; > Find out how you would change the default user name for all excel files. > If somebody could help please email me on georginacambridg@aol.com -- Dave Peterson ...

test
just trying to send you mail You've succeeded in posting your test to a newsgroup accessable by most anyone in the world who has a working internet connection. There is a difference between sending private e-mail messages and posting newsgroup messages. Tom Wickerath Microsoft Access MVP http://www.accessmvp.com/TWickerath/ http://www.access.qbuilt.com/html/expert_contributors.html __________________________________________ "Tamela mauldi" wrote: > just trying to send you mail ...

Internet e-mail settings test
When the settings test fails, where to I find information other than POP3 for my Incoming server and SMTP for my Outgoing server? "Dick" <RKrogs@aol.com> wrote in message news:08ac01c3d6e8$952c96f0$a001280a@phx.gbl... > When the settings test fails, where to I find information > other than POP3 for my Incoming server and SMTP for my > Outgoing server? What other information are you wanting? ...

merging Excel worksheets by email
If a person emails his worksheet to me which is set up the exact same way, how do I go about merging it with mine? Please be specific since this is new to me. (Excel2000) Barbara B Copy and Paste? Sorry, can't be more specific without knowing more about the problem. Anders Silv=E9n "bb" <bb@earthlink.net> skrev i meddelandet = news:Gtzob.10145$Px2.5091@newsread4.news.pas.earthlink.net... > If a person emails his worksheet to me which is set up the exact same = way, > how do I go about merging it with mine? Please be specific since this = is > new to me. (...

why stationery does not appear in other mail programs?
"Outlook Express" Stationery Badr <Badr@discussions.microsoft.com> wrote: > "Outlook Express" Stationery 1) Be more precise in your question. 2) Ask in an Outlook Express newsgroup. -- Brian Tillman ...

How to change default date formula on Excel worksheet
Excel 2007 Want to change the default formula for date on worksheet. Currently any date input auto displays as "17-Apr" for example. I know how to format to display 4/17/2010, but want this as default when I open the worksheet. In excel 2003 it was easy set up in "Options" in 2007, I can't seem to figure how to set this default. Advises please Change it Windows CP, Regional & Language Options. -- Regards Dave Hawley www.ozgrid.com "alexanderoux" <alexanderoux@discussions.microsoft.com> wrote in message news:6E394AB6-C944-4...

How do I get the extended file name of a file including server?
Using XP. I want to send file locations or shortcuts in an email rather than the actual file. How do I obtain the full extended file name including the server name and not just "G:" etc. so that other people in my workgroup can click on the file name and access the file immediately. If I understand correctly, you want to insert a link to a file rather than attach the file? This is assuming that the file is located somewhere that everyone can access it? (for example not in a home drive that only you have permission to) -- Kathleen Orland Outlook Tips: http://www.outlook-tip...

Can I set up AutoComplete not to forget names for 30 days?
Outlook's "AutoComplete" for cc, bcc etc... seem to remember email addresses for a few days only. Can we extend the time? Thx Autocomplete does not "forget" names. The autocomplete cache stores up to 1000 names. What version of Outlook are you using? "MagicMusic9" <MagicMusic9@discussions.microsoft.com> wrote in message news:8657EEE7-74B2-4E3B-8DB8-5037F739E7F3@microsoft.com... > Outlook's "AutoComplete" for cc, bcc etc... seem to remember email > addresses > for a few days only. Can we extend the time? > > Thx > ...

Site doesn't appear
Hi, all, I've installed my first E2K3 server, and it works great. The ADC connection to my production E5.5 server is working fine, too. Now, I'd like to add a second E2K3 server as a test machine, and make a connection to a second existing E5.5 test server, which is in a different site. The two sites have never been connected before, so yesterday I installed a site connector between the two sites - let's call them PRODUCTION and TEST. The site connector appeared to be created just fine - the PRODUCTION server found the TEST server, knew what site it was in, offered to create the...