+ Reply to Thread
Results 1 to 5 of 5

vba to name command buttons on a userform based on cell value on worksheet open event

  1. #1
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,034

    vba to name command buttons on a userform based on cell value on worksheet open event

    Hi All

    i have a Userform21 with 1-9 command buttons named 1 - 9.
    I have a list of Names in Sheets("Data Sheet").Range("J4:J12")

    Is it possible to have a macro rename the command buttons based on the Names in the range supplied. This is what I have currently...

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,034

    Re: vba to name command buttons on a userform based on cell value on worksheet open event

    Perhaps something to this effect - Not working.

    Please Login or Register  to view this content.

  3. #3
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,034

    Re: vba to name command buttons on a userform based on cell value on worksheet open event

    Hi All

    I went the long route by using following code. please advise on simpler code.

    Please Login or Register  to view this content.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: vba to name command buttons on a userform based on cell value on worksheet open event

    Try this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  5. #5
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,034

    Re: vba to name command buttons on a userform based on cell value on worksheet open event

    Perfect Norie

    Worked like a charm

+ 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] Using Command Button to Open Worksheet Based on ComboBox Selection
    By laura_jean in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-10-2014, 09:23 AM
  2. [SOLVED] ‘How to hide command button based on another cell - Additional buttons?’
    By tittbb in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-01-2014, 10:49 PM
  3. [SOLVED] Populate userform radio (option) buttons based on data in worksheet
    By d.sanchez in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-24-2013, 01:21 PM
  4. [SOLVED] Toggle command buttons between hidden and unhidden, based on cell value and CODE name
    By Willardio in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-01-2013, 02:27 PM
  5. Common Click event for all command buttons
    By getsunils in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-15-2011, 03:04 PM
  6. Create Command Buttons based on Worksheet Names
    By Qppg in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 01-20-2010, 12:53 AM
  7. Command button code to write to worksheet and then open userform
    By Reidm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-18-2008, 10:33 AM
  8. Replies: 1
    Last Post: 04-07-2006, 07:54 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