+ Reply to Thread
Results 1 to 5 of 5

Change values of labels in a userform through another userform

  1. #1
    Zhennie
    Guest

    Arrow Change values of labels in a userform through another userform

    Here is what I'm trying to do: Let's say I have a simple userform with labels as follows:

    (Label1) John's birthday: (Label2) 12.10.1974
    (Label3) Mary's birthday: (Label4) 15.03.1978

    (Button1) Change Birthdays

    Let's say want to change the birthdays I see, so I press the button and enter the new values through another userform with inputboxes.

    How do I make that change permanent, so that next time I start the macro in the labels 2 and 4 I have the last entered values for the birthdays???
    Last edited by Zhennie; 10-29-2009 at 05:34 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Change values of labels in a userform through another userform

    You can't unless the values are stored perhaps in a hidden sheet then used on initialising the form.

    I can't see why you are taking this approach. Why two userforms?

    Why not have a table of names birthdays & use the form to amend that, see thae databaseform here

    http://excel-it.com/vba_examples.htm
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Zhennie
    Guest

    Re: Change values of labels in a userform through another userform

    That would be easier, I guess. But it means there is no way to actually change the macro itself through a userform??

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Change values of labels in a userform through another userform

    You can change a macro through code, but it is not a simple process. The main point is that you cannot protect the VBA Project if you choose this method.

    See Chip Pearson

  5. #5
    Zhennie
    Guest

    Re: Change values of labels in a userform through another userform

    Thanks a lot. I guess I'm just observing the principle "Why should it be simple when it can be complicated."

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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