Solved

Edit macro to allow for worksheets in Active workbook

Posted on 2013-11-07
1
280 Views
Last Modified: 2013-11-07
Hi Expert's

how would I amend the following vba


Sub calcSheets() Dim WS_Count As Integer Dim I As Integer ' Set WS_Count equal to the number of worksheets in the active ' workbook. WS_Count = ActiveWorkbook.Worksheets.Count ' Begin the loop. For I = 1 To WS_Count ActiveWorkbook.Worksheets(I).EnableCalculation = False ActiveWorkbook.Worksheets(I).EnableCalculation = True Next I End Sub

so ws count corresponds to 7 worksheets. ..
0
Comment
Question by:route217
1 Comment
 
LVL 33

Accepted Solution

by:
Norie earned 500 total points
ID: 39630431
You can't change the count of worksheets unless you delete or add worksheets.

If you only want to loop through the first 7 worksheets use this.
For I =1 To 7

Open in new window


If it's 7 specific worksheets you want to work with we'll need more information.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

789 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