Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Does a worksheet exist

How can I tell if a particular sheet exists in a workbook

If it exists I want to delete it and create a new sheet with the same name

Kaval
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Does a worksheet exist

I guess I could run a little routine to scroll through each sheet in the workbpok and see if I get a match, but I was hoping for a one line solution if possibl

Kaval
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Does a worksheet exist

One way

Sub DelSheet()
Application.DisplayAlerts = False
On Error Resume Next
Sheets("sheet2").Delete
On Error GoTo 0
Application.DisplayAlerts = False
Sheets.Add
ActiveSheet.Name = "SHEET2"

End Su

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Does a worksheet exist

Here is my previous posted code all done on one line

Application.DisplayAlerts = False: On Error Resume Next:
Sheets("sheet2").Delete: On Error GoTo 0: Application.DisplayAlerts =
False: Sheets.Add: ActiveSheet.Name = "SHEET2"


---
Message posted from http://www.ExcelForum.com/

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
Does worksheet exist BB Ivan Excel Discussion (Misc queries) 1 January 29th 09 10:04 PM
Does Worksheet Exist BillCPA Excel Discussion (Misc queries) 5 April 19th 05 11:22 PM
Refrencing another cell in a worksheet that "could" exist KimberlyC Excel Worksheet Functions 1 February 7th 05 07:09 PM
Does worksheet exist Robert S Excel Programming 3 May 18th 04 07:59 PM
check if a worksheet exist - VBA Warren Excel Programming 1 September 10th 03 05:02 AM


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