Auto Load

S

Sean

I have created a user form that has several ComboBoxes.
What i want is for a default value to be present in the
box when the file is loaded. I have managed to use the
activate command to get this to happen if you change to a
different worksheet and then back again. Using this code

Private Sub Worksheet_Activate()
ComboBox1.Text = "Select Model"
ComboBox3.Text = "Select Coverage"
ComboBox2.Text = "Select Coverage"
ComboBox7.Text = "Select Configuration"
ComboBox4.Text = "Select Configuration"
ComboBox6.Text = "Select City"
ComboBox5.Text = "Select City"

But i cannot for the life of me understand how to trigger
this action automatically when the file is first opend !

Any answer would be appreciated

Thanks
 
L

Libby

Hi

I don't understand how you can switch sheets when you have
a userform running, so I guess your comboboxes are on the
worksheet.

Private Sub Workbook_Open()
with worksheets("name")
.combobox1 = "Select Model"
.combobox2 = "config"
etc
end with
end sub

incidentally are you actually loading the comboboxes with
anything?
 
G

Guest

Thanks Libby

I don't really understand what you mean by "loading the
c'boxes with something". They have a cell reference that
they pull the list items from on another worksheet which i
keep hidden usually. If i select a drop down option and
then save the entire file, when it is reopened the
selections i made are saved and populate the box. I don't
want this. I want a default value present on the box
whenevr the whole file is loaded. Does that make sense.?

Kinda new to all this ( if that wasn't immediately
apparent LOL
 
L

Libby

Hi

That makes sense about the cell ref.

The code I gave you before for the Workbook_Open event
should still reset the combobox's initial value to
whatever you want'
 

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

Similar Threads

Option group controlling objects 1
Loops 1
Advice rather than an actual question. 6
Clear unactive combo boxes 2
Refresh Problem 1
6 column sort 3
Form trouble 2
Help w/ CheckBox ????? 4

Top