+ Reply to Thread
Results 1 to 4 of 4

Click to update label name in a UserForm

  1. #1
    Registered User
    Join Date
    05-05-2021
    Location
    Edmonton
    MS-Off Ver
    office 13
    Posts
    2

    Click to update label name in a UserForm

    Hi all Master VBAs,

    I found a webpage a few days ago but I couldn't find it now even going through my web browser history.

    The webpage has a code that can update the control name as you click each control.

    For example here I have three label controls in a UserForm and would like to update the name as I click each of the label. So the code would be, although not correct but, something along the lines...


    Label 1 click
    Please Login or Register  to view this content.

    Label 2 click
    Please Login or Register  to view this content.


    Each of the control click calls for the same sub but only requires to pass certain information and "i" is determine by the control number...
    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    12-01-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    949

    Re: Click to update label name in a UserForm

    how about using two labels and just position them side by side so it looks as one label
    so when you click the left label the label next to it updates

    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,430

    Re: Click to update label name in a UserForm

    I assume you want to change the labels caption and not it's actual name, as you can not change the name at run time.

    This will add Happy to label text each time it's clicked.

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  4. #4
    Registered User
    Join Date
    05-05-2021
    Location
    Edmonton
    MS-Off Ver
    office 13
    Posts
    2

    Re: Click to update label name in a UserForm

    Many thanks Andy!!!

    This is what I am looking for!

+ 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] UserForm - Update Label with sheets
    By Bolo19911 in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 02-04-2019, 10:04 AM
  2. VBA update label per second once I click a button
    By toyborjaxk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-16-2016, 06:06 PM
  3. VBA Code to automatically update label in the userform
    By sn152 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-09-2014, 06:29 PM
  4. Use variable as name for label in userform, dynamically update different labels
    By seaofgreen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-09-2013, 04:12 PM
  5. Trying to Update Userform Label with worksheet cells
    By bmoon171 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-22-2013, 07:59 PM
  6. adding click commands to a userform label
    By moosemaster23 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-22-2013, 05:57 AM
  7. userform label double-click goes to click event
    By John Paul Fullerton in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-19-2006, 01:00 PM

Tags for this Thread

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