+ Reply to Thread
Results 1 to 5 of 5

Change Command Button name/comment based on cell value

  1. #1
    Forum Contributor
    Join Date
    08-16-2012
    Location
    Sefton
    MS-Off Ver
    MS Office 365 ProPlus
    Posts
    133

    Change Command Button name/comment based on cell value

    Eqpt Example.xlsx

    The attached is a basic layout plan of what I have. It's pretty much all ActiveX controls though.
    The users is able to select the total number (D2 & D13) listed in Row A of Eqpt A and Equip B which will pre-populate, the user then selects the other options from more buttons.

    The numbers listed in A15:A19 can be changed between single and double by clicking another button. The list will automatically update based on the options selected - e.g if the user changed A17 to single the list would show the 5 options as;
    1,2
    3,4
    5
    6,7
    8 (A19 is already set to single, for #9 to be reintroduced A19 would need to be set to double)

    What I want is for B23:F29 (which are also ActiveX Command Buttons) to change based on the information in A15:A19 (there can be up to 25 rows in both Eqpt A and Eqpt B). I know how to do it if it wasn't buttons and was just cells, it's the VBA code that i'm not too familiar with, i'm pretty new to VBA so if anything you post had a bit of description as to what each line is doing that would be great.

    Each table (A,B,C) is on a separate tab, and I have given the user a 'next' command button to move to the next table, so any page refresh that might be required to update the information in the Eqpt C table can be put in there.

    Let me know if there's any more info you require, i've probably only explained it well enough for myself to understand what i'm trying to accomplish. It's the name/comment visible on each ActiveX Command Button that I want to be able to automatically change based on the values listed in the tables above.
    Last edited by DHFE; 10-16-2015 at 07:10 AM.

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,906

    Re: Change Command Button name/comment based on cell value

    Hi,
    Where's the command button? This file is just a table
    Nothing much there
    Which version of excel, I'm assuming at least 2007 because it's xslx but...
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Forum Contributor
    Join Date
    08-16-2012
    Location
    Sefton
    MS-Off Ver
    MS Office 365 ProPlus
    Posts
    133

    Re: Change Command Button name/comment based on cell value

    I'm using 2010. I know there's no buttons in the example - this is a quick layout of what I have, i'm working on a sensitive document so cant upload that. Pretty much every cell is a button in my workbook.

    As stated i'm looking for the buttons which would be located instead of cells B23:F29 to respond to the values pre-populated in cells A15:A19

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,906

    Re: Change Command Button name/comment based on cell value

    Okay, I'm not that good with ActiveX buttons, don't like them, I use userform buttons that trigger a macro
    I've attached a sample that uses a userform button and changes the button's caption
    Just press it several time evry time a different text is shown, The actual text you see if placed in cell F5 so it's hidden behind the button (cosmetic reason )

    You can pass any text to want

    Hope this helps to give you an idea.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    08-16-2012
    Location
    Sefton
    MS-Off Ver
    MS Office 365 ProPlus
    Posts
    133

    Re: Change Command Button name/comment based on cell value

    That looks good, thanks for the help.

+ 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. Help Hiding A Command Button Based Cell Value
    By dd510 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-10-2014, 05:30 AM
  2. How to hide command button based on another cell?
    By proepert in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-27-2014, 09:28 AM
  3. Click Command Button, run macros based on cell value
    By mc1963 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-28-2012, 04:08 PM
  4. Code for a master command button to change the backcolor of multiple command buttons?
    By panttherm5 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-16-2012, 10:11 PM
  5. Change same cell on all sheets but the first with a command button
    By soadokdls in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-16-2012, 08:38 PM
  6. [SOLVED] Change Command Button Colour Based on Cell
    By adam.hewitt5 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-08-2012, 09:43 AM
  7. [SOLVED] Hide/Show Command button based on cell value
    By paxile2k in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-13-2010, 08:59 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