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: 8,856
Default If named sheet exists then delete it

I am creating a new sheet in a macro and then renaming it to Test with
the following lines:

Sheets.Add
ActiveSheet.Name = "Test"

However, there might already be a sheet called Test in the workbook
from an earlier (failed) run of the macro. How can I detect if that
sheet exists and delete it if it does exist before the above lines of
code?

Many thanks,

Pete
 
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 sheet exists and it is named run this code Jazz Excel Programming 4 October 6th 09 04:03 PM
If sheet exists, delete Darin Kramer Excel Programming 2 August 20th 07 07:01 PM
Delete broken named ranges in sheet akyhne[_2_] Excel Programming 13 August 15th 05 10:53 PM
How do I delete all named ranges in a sheet at one time? L.Wall Excel Worksheet Functions 2 July 13th 05 03:29 PM
how to tell if a named range exists Gixxer_J_97[_2_] Excel Programming 2 June 1st 05 07:38 PM


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