+ Reply to Thread
Results 1 to 7 of 7

ActiveX button calling VBA from another hidden tab ?

  1. #1
    Forum Contributor
    Join Date
    08-28-2015
    Location
    Montreal, Canada
    MS-Off Ver
    2013 on PC, 2011 on MAC
    Posts
    159

    ActiveX button calling VBA from another hidden tab ?

    Hey guys,

    I'm currently reworking a xlsm file, almost from scratch (learned so many new things eversince I started posting here that I just had to do it). But before I do, I need to make sure of one thing; is it possible for an ActiveX button, placed on sheet1, to call a VBA procedure that is placed on a different hidden sheet (results of that VBA procedure are also posted on that same hidden sheet) ?

    Just want to make sure to do the right thing before I get any further.

    Thanks.
    Last edited by KomicJ; 10-16-2015 at 09:58 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,939

    Re: Before I rework my document...

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (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

  3. #3
    Forum Contributor
    Join Date
    08-28-2015
    Location
    Montreal, Canada
    MS-Off Ver
    2013 on PC, 2011 on MAC
    Posts
    159

    Re: ActiveX button calling VBA from another tab ?

    Sorry, didn't know. Adjusted.

  4. #4
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: ActiveX button calling VBA from another hidden tab ?

    Hi Komicj,
    Sure it's possible but you the syntax is slightly different. Instead of placing your VBA procedure in your hidden sheet, why not simply place it in a Module.

    For example, assuming you have an ActiveX button in Sheet1:

    code in sheet1

    Please Login or Register  to view this content.

    code in sheet2
    Please Login or Register  to view this content.

    code in Module1
    Please Login or Register  to view this content.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  5. #5
    Forum Contributor
    Join Date
    08-28-2015
    Location
    Montreal, Canada
    MS-Off Ver
    2013 on PC, 2011 on MAC
    Posts
    159

    Re: ActiveX button calling VBA from another hidden tab ?

    To be honest, I'm not nearly familiar enough with VBA to understand the code. I have a code that works right now (though it'll need some tweaking), but that part will probably be taken care of by someone else. I just wanted to make sure my layout was going to work for what I had in mind.

    So, even if hidden, I'll be able to collect the data (it's basically a webquery), post the results on the hidden page, and use that data as reference for my other sheets...correct ?

  6. #6
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: ActiveX button calling VBA from another hidden tab ?

    Yes, that's correct.
    It doesn't matter if your sheet is hidden or not. You can still use it read / write data to it.
    I ofter use hidden sheets in my projects to store some parameters used.

  7. #7
    Forum Contributor
    Join Date
    08-28-2015
    Location
    Montreal, Canada
    MS-Off Ver
    2013 on PC, 2011 on MAC
    Posts
    159

    Re: ActiveX button calling VBA from another hidden tab ?

    Awesome, thanks a lot.
    Edit: Rep added.

+ 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. Rework _KeyPress code into a sub routine or class that can be called by multiple events
    By jonharrell in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-04-2015, 02:31 AM
  2. [SOLVED] Merge cells with same value, old code needs rework.
    By johansoder in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-23-2014, 09:14 AM
  3. Replies: 0
    Last Post: 05-28-2014, 04:18 PM
  4. [SOLVED] Rework in vba code to refresh sum value.
    By satputenandkumar0 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-15-2013, 02:54 AM
  5. [SOLVED] Compound If()Countif() formula that needs rework. *first post*
    By Leif Magnus in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-25-2012, 10:48 PM
  6. how do i rework the sequence of data
    By ranjan in forum Excel General
    Replies: 3
    Last Post: 05-08-2007, 09:11 AM

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