Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Simple excel vba question

Posted on 2013-05-17
2
432 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
ID: 39175314
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
ID: 39180180
Sorry for delay in replying - that is what i was looking for.
Pls accept these points with my thanks :)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This collection of functions covers all the normal rounding methods of just about any numeric value.
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

808 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