Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 . . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 . . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
csv, how to set excel to auto load | Excel Discussion (Misc queries) | |||
auto load data from one workbook to another | Excel Worksheet Functions | |||
File takes 40 minutes to load (auto-calculation) | Excel Discussion (Misc queries) | |||
Auto load macros | Excel Programming | |||
Excel :: Creating Entry Forms that auto load a workbook | Excel Programming |