Solved

Edit macro to allow for worksheets in Active workbook

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

920 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

12 Experts available now in Live!

Get 1:1 Help Now