ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Auto Load (https://www.excelbanter.com/excel-programming/285152-auto-load.html)

Sean[_7_]

Auto Load
 
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

libby

Auto Load
 
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?

-----Original Message-----
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
.


No Name

Auto Load
 
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

-----Original Message-----
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?

-----Original Message-----
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
.

.


libby

Auto Load
 
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'

-----Original Message-----
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

-----Original Message-----
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?

-----Original Message-----
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
.

.

.



All times are GMT +1. The time now is 03:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com