Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro Help - check existing tabs

I have a macro that takes data from an existing tab,
creates a new tab called "Final", and does some
formatting stuff with it. An improvement I want to make
is to have the macro check the workbook at the beginning
to see if it already has an existing "Final" tab, and if
so, prompt the user whether to delete the existing tab or
quit the macro. How do I make this work?

Thank you
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Macro Help - check existing tabs

Dim oSheet As Worksheet

On Error Resume Next
Set oSheet = Worksheets("Sheet1")
On Error GoTo 0
If oSheet Is Nothing Then
Worksheets.Add.Name = "Sheet1"
End If

--
HTH

-------

Bob Phillips
"Macro Help" wrote in message
...
I have a macro that takes data from an existing tab,
creates a new tab called "Final", and does some
formatting stuff with it. An improvement I want to make
is to have the macro check the workbook at the beginning
to see if it already has an existing "Final" tab, and if
so, prompt the user whether to delete the existing tab or
quit the macro. How do I make this work?

Thank you



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
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
How do I sort tabs on an existing spreadsheet? IRISHBABE Excel Worksheet Functions 2 December 19th 06 02:06 AM
Rename all existing worksheet tabs MikeM Excel Discussion (Misc queries) 14 October 20th 06 03:29 AM
add a check box on Excel tabs seb Setting up and Configuration of Excel 2 October 19th 05 02:51 PM
Check boxes to show/hide Tabs Sridhar Rao Excel Worksheet Functions 1 January 5th 05 03:28 PM


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