+ Reply to Thread
Results 1 to 3 of 3

Apply Macro to multiple Sheets

  1. #1
    Registered User
    Join Date
    02-13-2017
    Location
    pittsburgh
    MS-Off Ver
    2007
    Posts
    16

    Apply Macro to multiple Sheets

    Hi Guys,
    I currently have this macro that runs on the active sheet.

    Sub Refresh_Click()
    x = HypUIConnect(Empty, Empty, Empty, vtFriendlyName:=”ESSPRD2_MPSA_P_CorePlan“)
    x = HypMenuVRefresh
    End Sub


    I want to apply this macro to run when I click my button to the following sheets. Below are my sheet names

    By product Opex
    By Division Opex
    OpEx By acct
    By product
    By Division
    Site Count
    HeadC

    Can anyone

  2. #2
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Akron, OH
    MS-Off Ver
    15.0
    Posts
    424

    Re: Apply Macro to multiple Sheets

    You can loop through all Worksheets easily enough and store all of the names above in a few different ways, but I'm concerned about the scope of your HypUIConnect and HypMenuVRefresh functions -- but I don't know anything about them.

    For instance, a module may contain:

    Please Login or Register  to view this content.
    <---If my answer helped, please click *

  3. #3
    Administrator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs
    MS-Off Ver
    MS Office 365 Win 11 Home 64 Bit
    Posts
    21,877

    Re: Apply Macro to multiple Sheets

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Alan


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] unlock sheets apply macro then lock sheets again
    By k1dr0ck in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-22-2015, 10:21 PM
  2. [SOLVED] Apply macro to multiple sheets.
    By dzugan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-24-2013, 12:57 AM
  3. How do I apply a filter across multiple sheets
    By Dan1956 in forum Excel General
    Replies: 0
    Last Post: 08-07-2012, 09:33 AM
  4. Macro to apply subtotals to multiple sheets
    By Scotbot in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-20-2012, 09:10 AM
  5. Is It Possible To Apply Changes To Multiple Sheets
    By globalpontoon in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-16-2011, 07:45 PM
  6. Apply Print Settings to Multiple Sheets via MACRO
    By ShaneBell in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-20-2009, 08:48 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1