Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Jenn
 
Posts: n/a
Default deleting worksheets from names in a range

Is there anyway to delete worksheets via code where one worksheet contains a
range with the names of the tabs on the worksheets I want to delete?
i.e., Sheet 1 has a range that has the values, A, B, C.
These are the names on tabs for 3 worksheets. I want to have code that says
"delete worksheets with the tabs named A, B, C.
Let me know if you need more info.
TIA!
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default


With Worksheets("Sheet1")
Application.DisplayAlaerts = False
For i = 1 To Cells(Rows.Count,"A").End(xlUp).Row
On Error Resume Next
Worksheets(Cells(i,"A").Value).Delete
On Error Goto 0
Next i
Application.DisplayAlerts = True
End With

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Jenn" wrote in message
...
Is there anyway to delete worksheets via code where one worksheet contains

a
range with the names of the tabs on the worksheets I want to delete?
i.e., Sheet 1 has a range that has the values, A, B, C.
These are the names on tabs for 3 worksheets. I want to have code that

says
"delete worksheets with the tabs named A, B, C.
Let me know if you need more info.
TIA!



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
Invalid Range Names Old Music Lover Excel Discussion (Misc queries) 4 July 23rd 05 01:53 AM
Create a list in one worksheet of the other worksheets' names Kelli Excel Worksheet Functions 0 July 7th 05 08:45 PM
Sorting names in a range John S Excel Worksheet Functions 2 April 4th 05 06:36 AM
Deleting Names in Excel 2003 steve_nelson Excel Discussion (Misc queries) 2 January 6th 05 12:56 PM
SUMIF across a range of worksheets Mike@Q Excel Worksheet Functions 3 November 24th 04 02:36 PM


All times are GMT +1. The time now is 04:50 AM.

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"