+ Reply to Thread
Results 1 to 2 of 2

saving and reloading the contents of a userform

  1. #1
    bennyob
    Guest

    saving and reloading the contents of a userform

    How do I save the contents of a userform, say as text, then how do I add the
    button to browse and reload the saved file.

  2. #2
    Rowan Drummond
    Guest

    Re: saving and reloading the contents of a userform

    It is easier to use a hidden excel sheet in the book that contains the
    userform. I have a form with 1 textbox, 2 checkboxes, a Close button and
    a Reload button. There is a sheet in the book called FromData and the
    sheets visible property is set to xlVeryHidden.

    When the user clicks close the forms settings are saved to the FormData
    sheet. Next time the form is loaded if the user clicks Reload the
    settings are returned to the form:

    Private Sub cmdClose_Click()
    With Sheets("FormData")
    .Range("A1").Value = Me.TextBox1.Text
    .Range("A2").Value = Me.CheckBox1.Value
    .Range("A3").Value = Me.CheckBox2.Value
    End With
    Unload Me
    End Sub

    Private Sub cmdReload_Click()
    With Sheets("FormData")
    Me.TextBox1.Text = .Range("A1").Value
    Me.CheckBox1.Value = .Range("A2").Value
    Me.CheckBox2.Value = .Range("A3").Value
    End With
    End Sub

    Hope this helps
    Rowan

    bennyob wrote:
    > How do I save the contents of a userform, say as text, then how do I add the
    > button to browse and reload the saved file.


+ 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