Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ComboBox
Hello! I have a ComboBox being populated with a named range of dates
(called date). In another cell (named range "default") I have todays date. How can I have the value in the combobox default to todays date, or essentially default to the named range "default"? Thanks in advance!! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
ComboBox
How about just setting the value?
me.combobox1.value = format(date,"mm/dd/yyyy") Steph wrote: Hello! I have a ComboBox being populated with a named range of dates (called date). In another cell (named range "default") I have todays date. How can I have the value in the combobox default to todays date, or essentially default to the named range "default"? Thanks in advance!! -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
ComboBox
I tried that, but I'm not sure where to put that line of code. I tried it
at the beginning of my showform code below, but errored: Sub ShowUserForm() ComboBox1.Value = Worksheets("Sheet2").Range("A1").Value UserForm1.Show End Sub "Dave Peterson" wrote in message ... How about just setting the value? me.combobox1.value = format(date,"mm/dd/yyyy") Steph wrote: Hello! I have a ComboBox being populated with a named range of dates (called date). In another cell (named range "default") I have todays date. How can I have the value in the combobox default to todays date, or essentially default to the named range "default"? Thanks in advance!! -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
ComboBox
Try putting it in the _initialize procedure (behind the userform):
Private Sub UserForm_Initialize() me.ComboBox1.Value = Worksheets("Sheet2").Range("A1").Value 'or me.ComboBox1.Value = Worksheets("Sheet2").Range("A1").Text 'or me.ComboBox1.Value _ = format(Worksheets("Sheet2").Range("A1").Value, "mm/dd/yyyy") End Sub Only use one of those, though. Steph wrote: I tried that, but I'm not sure where to put that line of code. I tried it at the beginning of my showform code below, but errored: Sub ShowUserForm() ComboBox1.Value = Worksheets("Sheet2").Range("A1").Value UserForm1.Show End Sub "Dave Peterson" wrote in message ... How about just setting the value? me.combobox1.value = format(date,"mm/dd/yyyy") Steph wrote: Hello! I have a ComboBox being populated with a named range of dates (called date). In another cell (named range "default") I have todays date. How can I have the value in the combobox default to todays date, or essentially default to the named range "default"? Thanks in advance!! -- Dave Peterson -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
ComboBox
None of them worked. I am so confused!!
"Dave Peterson" wrote in message ... Try putting it in the _initialize procedure (behind the userform): Private Sub UserForm_Initialize() me.ComboBox1.Value = Worksheets("Sheet2").Range("A1").Value 'or me.ComboBox1.Value = Worksheets("Sheet2").Range("A1").Text 'or me.ComboBox1.Value _ = format(Worksheets("Sheet2").Range("A1").Value, "mm/dd/yyyy") End Sub Only use one of those, though. Steph wrote: I tried that, but I'm not sure where to put that line of code. I tried it at the beginning of my showform code below, but errored: Sub ShowUserForm() ComboBox1.Value = Worksheets("Sheet2").Range("A1").Value UserForm1.Show End Sub "Dave Peterson" wrote in message ... How about just setting the value? me.combobox1.value = format(date,"mm/dd/yyyy") Steph wrote: Hello! I have a ComboBox being populated with a named range of dates (called date). In another cell (named range "default") I have todays date. How can I have the value in the combobox default to todays date, or essentially default to the named range "default"? Thanks in advance!! -- Dave Peterson -- Dave Peterson |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
ComboBox
What did you do and what happened when you tried it?
Steph wrote: None of them worked. I am so confused!! "Dave Peterson" wrote in message ... Try putting it in the _initialize procedure (behind the userform): Private Sub UserForm_Initialize() me.ComboBox1.Value = Worksheets("Sheet2").Range("A1").Value 'or me.ComboBox1.Value = Worksheets("Sheet2").Range("A1").Text 'or me.ComboBox1.Value _ = format(Worksheets("Sheet2").Range("A1").Value, "mm/dd/yyyy") End Sub Only use one of those, though. Steph wrote: I tried that, but I'm not sure where to put that line of code. I tried it at the beginning of my showform code below, but errored: Sub ShowUserForm() ComboBox1.Value = Worksheets("Sheet2").Range("A1").Value UserForm1.Show End Sub "Dave Peterson" wrote in message ... How about just setting the value? me.combobox1.value = format(date,"mm/dd/yyyy") Steph wrote: Hello! I have a ComboBox being populated with a named range of dates (called date). In another cell (named range "default") I have todays date. How can I have the value in the combobox default to todays date, or essentially default to the named range "default"? Thanks in advance!! -- Dave Peterson -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
fill combobox depending on selection from another combobox | Excel Discussion (Misc queries) | |||
Combobox items determined by the selection in another combobox | Excel Programming | |||
Combobox options based on the input of another combobox | Excel Programming | |||
ComboBox list reliant on the entry from a different ComboBox | Excel Programming | |||
How Do I Load A ComboBox RowSource From The Results Of Another ComboBox | Excel Programming |