Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Delete Selected Worksheets Macro

I have a workbook with 500 tabs. 200 of the tabs are named: FI (1), FI (2),
FI (3), etc. I want to delete all tabs that start with FI.

I've tried the below without success - any suggestions? Here's what I have:

Dim ws As Worksheet
Application.DisplayAlerts = False
For Each ws In Worksheets
If ws.Name = "FI (*)" Then ws.Delete
Next
Application.DisplayAlerts = True

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Delete Selected Worksheets Macro

Sub FI_killer()
Application.DisplayAlerts = False
For Each w In Worksheets
If Left(w.Name, 2) = "FI" Then
w.Delete
End If
Next
Application.DisplayAlerts = True
End Sub

--
Gary''s Student - gsnu200822


"Indianagreg" wrote:

I have a workbook with 500 tabs. 200 of the tabs are named: FI (1), FI (2),
FI (3), etc. I want to delete all tabs that start with FI.

I've tried the below without success - any suggestions? Here's what I have:

Dim ws As Worksheet
Application.DisplayAlerts = False
For Each ws In Worksheets
If ws.Name = "FI (*)" Then ws.Delete
Next
Application.DisplayAlerts = True

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Delete Selected Worksheets Macro

Perfect! Thank you and Happy New Year

"Gary''s Student" wrote:

Sub FI_killer()
Application.DisplayAlerts = False
For Each w In Worksheets
If Left(w.Name, 2) = "FI" Then
w.Delete
End If
Next
Application.DisplayAlerts = True
End Sub

--
Gary''s Student - gsnu200822


"Indianagreg" wrote:

I have a workbook with 500 tabs. 200 of the tabs are named: FI (1), FI (2),
FI (3), etc. I want to delete all tabs that start with FI.

I've tried the below without success - any suggestions? Here's what I have:

Dim ws As Worksheet
Application.DisplayAlerts = False
For Each ws In Worksheets
If ws.Name = "FI (*)" Then ws.Delete
Next
Application.DisplayAlerts = True

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Delete Selected Worksheets Macro

You too!
--
Gary''s Student - gsnu200822


"Indianagreg" wrote:

Perfect! Thank you and Happy New Year

"Gary''s Student" wrote:

Sub FI_killer()
Application.DisplayAlerts = False
For Each w In Worksheets
If Left(w.Name, 2) = "FI" Then
w.Delete
End If
Next
Application.DisplayAlerts = True
End Sub

--
Gary''s Student - gsnu200822


"Indianagreg" wrote:

I have a workbook with 500 tabs. 200 of the tabs are named: FI (1), FI (2),
FI (3), etc. I want to delete all tabs that start with FI.

I've tried the below without success - any suggestions? Here's what I have:

Dim ws As Worksheet
Application.DisplayAlerts = False
For Each ws In Worksheets
If ws.Name = "FI (*)" Then ws.Delete
Next
Application.DisplayAlerts = True

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
Delete selected worksheets Casey Excel Programming 4 November 14th 08 09:48 AM
Looping through selected worksheets and delete a range (e.g., A2:D15) [email protected] Excel Programming 1 October 10th 07 01:41 AM
Delete rows at the same time from selected worksheets Filo Excel Programming 3 May 5th 07 02:41 PM
trying to delete selected range with macro DKY[_74_] Excel Programming 7 August 27th 05 01:58 PM
Need a macro to delete selected rows RKettle Excel Programming 5 January 13th 04 05:29 PM


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