View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Setting properties of userform controls with VBA

Dave,

Why do you want to save it with the form, what is wrong with the worksheet?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Dave" wrote in message
...
Hi

I want to be able to set a controls properties, so that they are
"remembered" for the next time that the spreadsheet is openned.

For example;

I have a userform, with a textbox. I can open up the VB editor, and

against
"Value" for the textbox, in the forms properties, I can enter a value.

This
value is then saved with the form, and does not rely on the textbox

getting
its value from elsewhere, each time the form is openned. Is it possible to
set the value with VBA, as though it was typed in on the editor? I know

how
to set it with variables, but I want to essentially store the value with

the
forms properties. If i try something like;

MyUserform.MyTextbox.Value = Sheets("Sheet1").Range("A1") whilst it

will
show the value in the textbox, it does not save the value with the forms
properties.

The basic reason for me needed this, is I want to have a "Spreadsheet
Settings" form, that does not rely on a worksheet for its values. I want
them all to be held within the form.

Any help much appreciated.

Dave