The use of "Calculate"
Find bottlenecks in your Excel workbooks
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: The use of "Calculate"

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Location
    Montreal, Quebec
    Posts
    194
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    A couple of quick questions:

    1. If I have two workbooks open, both with "Sheet1", would WorkSheets(1).Calculate only affect the Workbook I am currently working on? If not, is there a way to get around this?

    2. What if a Workbook has more than 1 sheet to update - do I have to specify each separate worksheet as in the first example?

    Thanks

  2. #2
    MrExcel MVP Barrie Davidson's Avatar
    Join Date
    Feb 2002
    Location
    Winnipeg
    Posts
    2,330
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    On 2002-03-04 07:05, Skippy wrote:
    A couple of quick questions:

    1. If I have two workbooks open, both with "Sheet1", would WorkSheets(1).Calculate only affect the Workbook I am currently working on? If not, is there a way to get around this?

    2. What if a Workbook has more than 1 sheet to update - do I have to specify each separate worksheet as in the first example?

    Thanks
    1. It would only calculate the first worksheet in the active workbook (note, the first workbook might not necessarily be named "Sheet1").

    2. If you only want to calculate all sheets in that specific workbook, then you will have to calc each worksheet separately. Something like:
    Code:
    Dim ws As Worksheet
    For Each ws In ActiveWorkbook
        ws.Calculate
    Next ws
    Regards,
    Barrie Davidson

    "You're only given a little spark of madness. You mustn't lose it." - Robin Williams

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com