Consulting

Results 1 to 5 of 5

Thread: SOLVED: Run macro all all open workbooks with one exception

  1. #1

    SOLVED: Run macro all all open workbooks with one exception

    Hi I'm still pretty new to VBA,

    I would like to run a macro on all open workbooks with the exception of one (which is the workbook i have my macros stored on). Could anyone help thanks
    Last edited by RobertHT; 02-18-2009 at 06:00 PM.

  2. #2
    sorted...

  3. #3
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,962
    Location
    What does sorted mean?

    Depends on what you macro will do. Maybe something like:
    [VBA]Sub RunMyMac()
    Dim wb As Workbook
    For Each wb In Workbooks
    If wb.Name <> ThisWorkbook.Name Then
    wb.Activate
    MyMac
    End If
    Next wb
    End Sub
    [/VBA]

  4. #4
    hey ken,

    thanks for that. How do i change the thread to solved?

  5. #5
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,364
    Location
    Greetings Robert,

    Above your first post, click the button "Thread Tools" and Marked Solve is available to the original poster.

    Have a great day,

    Mark

Posting Permissions

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