UserForm code help needed.

  • Thread starter Thread starter madbloke
  • Start date Start date
M

madbloke

Very helpful, and it works exactly as you say.

Getting slightly more technical now, I have set the combobox to have
default setting (so it doesnt appear blank when the form i
initialized). Also, one of the Textboxes has today's date inpu
automatically. However, when the form resets using your code, thes
things disappear. I've tried deleting the line that sets the control
to "", but that leaves everything (even the user typed entries)

Is there a simple way around this, or would it involve some seriou
(and probably waaaay over my head!) coding? I'm kind of learning VBA o
the fly, and I'm finding these examples VERY useful. Thanks to all wh
are trying to help a complete novice!
 
keeping things simple, you could:

add an if test like:
If na <> 1 or na <> 3 Then
Controls(na) =""
End if
in your For next loop to exclude the combo / textboxes you
want to keep the values from being deleted
or
you could after the For loop just place the data back in eg

Textbox1.Text = date

Hope helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top