+ Reply to Thread
Results 1 to 2 of 2

Userforms remembering values

  1. #1
    Forum Contributor
    Join Date
    09-02-2005
    Posts
    146

    Userforms remembering values

    What is the best way to have a userform remember values that someone put in earlier? I'm putting an "Options" page onto a spread sheet that I'm working with and I want it to show what was previously entered if someone exits then reopens the workbook.

    I can get it to work if I put in a line for each thing that needs to be remembered before showing the userform, for example:

    Private Sub CommandButton2_Click()
    options.LaborRate.Value = Sheets("admin").Range("b3").Value * 100 & "%"
    options.LaborValue.Value = "$" & Sheets("admin").Range("c3").Value * 100
    options.EngRate.Value = Sheets("admin").Range("b4").Value * 100 & "%"
    options.EngValue.Value = "$" & Sheets("admin").Range("c4").Value
    options.Show
    End Sub
    I've yet to find any examples of someone calling up previous information into the form, but so far this is the best way I can find.

    Is there a userform_open() command similar to the workbook_open() command?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Wilro85,

    UserForms only retain information about the objects that are a part of the UserForm. Data has to stored externally, and loaded back into the controls whenever the UserForm is run. No there is no UserForm_Open() event. The only events that deal with the UserForm starting up are the UserForm_Intialize and UserForm_Activate() events.

    Sincerely,
    Leith Ross

+ 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