Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default How to delete worksheet with specific criteria

Hi expert,

I am looking for a VBA code with following purpose:

Delete worksheets with column grand of pivot table (pivot table name
unknown) = 0 AND worksheet name contain "@"?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default How to delete worksheet with specific criteria

What if I want to delete worksheet with worksheet name "@" AND contain no
number in column A (but will have text)? I use following code but doesn't
work.

Sub DeleteBlankSheet()
For Each ws In ThisWorkbook.Worksheets
If (InStr(ws.Name, "@") 0 And IsNumeric(ws.Range("A:A")) = False)
Then
Application.DisplayAlerts = False
ws.Delete
Else
Cells.EntireColumn.AutoFit
Application.DisplayAlerts = True
End If
Next ws
End Sub

"Angus" wrote:

Hi expert,

I am looking for a VBA code with following purpose:

Delete worksheets with column grand of pivot table (pivot table name
unknown) = 0 AND worksheet name contain "@"?

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
How to delete a specific LegendEntry? Intuitive Analyst Charts and Charting in Excel 4 January 29th 08 03:21 PM
Delete all after a specific date George Excel Discussion (Misc queries) 2 November 17th 06 04:59 PM
Delete rows if specific criteria not met. SITCFanTN Excel Worksheet Functions 3 July 5th 06 12:20 AM
I want to delete certain rows based on specific criteria Alaphas Excel Programming 2 May 18th 05 11:06 PM
Cut & Paste Data into different worksheet based on specific criteria hailnorm[_2_] Excel Programming 2 December 6th 03 10:56 PM


All times are GMT +1. The time now is 06:11 AM.

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"