Solved

Edit macro to allow for worksheets in Active workbook

Posted on 2013-11-07
1
276 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

809 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