+ Reply to Thread
Results 1 to 7 of 7

Help Clicking Current Selection via VBA

  1. #1
    Registered User
    Join Date
    06-10-2020
    Location
    Reno
    MS-Off Ver
    365
    Posts
    22

    Help Clicking Current Selection via VBA

    Hey Everyone,

    I have a sheet with about 200 buttons, each have been named AND have different macros.

    I have a dynamic table on another sheet with a "Master Button". When you click on the "Master Button", I have a macro that selects 1 of the 200 buttons based off of the current selected location cell.

    It works very well at moving to the appropriate sheet and selecting the correct object BUT

    1) I can't figure out how to click that selected object via VBA.

    2) I only want the macro to run if
    --A) The selected cell has a value OR
    --B) The user has only one cell selected within range C5:C600

    Here is my code:
    Please Login or Register  to view this content.
    I will attach my workbook so you can see exactly what I am dealing with. Let me know if you need any more details.

    Thank you all in advance
    Last edited by guitarmonkeys14; 07-01-2020 at 06:13 PM. Reason: Solved

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Help Clicking Current Selection via VBA

    How about
    Please Login or Register  to view this content.

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Help Clicking Current Selection via VBA

    As you have named the buttons you could use application.caller to get the name of the shape and then create a object reference.

    If you then did the same on the map, name the textboxs with same room reference, you could get away with 2 routines to get the room and then position the pointer
    Cheers
    Andy
    www.andypope.info

  4. #4
    Registered User
    Join Date
    06-10-2020
    Location
    Reno
    MS-Off Ver
    365
    Posts
    22

    Re: Help Clicking Current Selection via VBA

    This seems to work perfectly! Thank you buddy.

    Do you know how I could only get the macro to run if a cell in the C column is selected?

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Help Clicking Current Selection via VBA

    Put this into the master sheet module
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    06-10-2020
    Location
    Reno
    MS-Off Ver
    365
    Posts
    22

    Thumbs up Re: Help Clicking Current Selection via VBA

    Quote Originally Posted by Fluff13 View Post
    Put this into the master sheet module
    Please Login or Register  to view this content.
    This would have probably been so much easier than what I ended up doing

    I just came back on to post what I figured out to work, I wish I would have checked earlier haha.

    This is what I did:
    Please Login or Register  to view this content.
    Thank you again so much for your help Fluff13

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Help Clicking Current Selection via VBA

    You're welcome & thanks for the feedback.

+ 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. Only allowed cells to be filled by double clicking for current time and date
    By iekrisnadi in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-23-2017, 05:47 PM
  2. [SOLVED] VBA copy paste a selection then find the current date and copy this selection row 61
    By woocaro in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-30-2015, 11:07 AM
  3. Class Module for Clicking Shapes to Show Current Time
    By clabulis in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-08-2015, 09:03 AM
  4. [SOLVED] Add to Selection by Right Clicking & Union
    By TheSpriceEffect in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-15-2014, 10:59 PM
  5. [SOLVED] Enter current Time by clicking in cell
    By WFP111 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-14-2013, 08:52 AM
  6. [SOLVED] change current pie chart by clicking on one part of the pie.
    By Bazinga in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-19-2012, 04:34 AM
  7. Insert Current date in cell by clicking it
    By DK1981 in forum Excel General
    Replies: 2
    Last Post: 11-10-2011, 08:06 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