Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving Userform as Gif Robert[_24_] Excel Programming 7 June 13th 13 05:12 AM
Reloading values in optionbuttons or checkboxes Redondo7 Excel Programming 2 August 24th 05 01:35 PM
userform txt box contents Nigel Excel Discussion (Misc queries) 11 May 5th 05 01:44 PM
reloading a userform query anthony slater Excel Programming 1 October 7th 04 04:30 PM
reloading arrays JJ[_5_] Excel Programming 2 April 7th 04 09:15 PM


All times are GMT +1. The time now is 09:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"