Solved

Simple excel vba question

Posted on 2013-05-17
2
423 Views
Last Modified: 2013-05-19
Hello,
Within a workbook I have a number of sheets, which could be named from 1-??? - ??? denoting infinity.
I need a simple macro to loop through the workbooks, if the sheet name is between 1 & ??? then delete it.
TIA.
0
Comment
Question by:Ot_Gu
2 Comments
 
LVL 39

Accepted Solution

by:
nutsch earned 500 total points
Comment Utility
Assuming your workbooks are open already:

sub deleteNumericSheets
dim wbk as workbook, sht as worksheet

application.displayalerts=false

for each wbk in activewindow.workbooks
for each sht in wbk.worksheets
if isnumeric(sht.name) then sht.delete
next sht

next wbk

application.displayalerts=true

end sub
0
 

Author Closing Comment

by:Ot_Gu
Comment Utility
Sorry for delay in replying - that is what i was looking for.
Pls accept these points with my thanks :)
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now