Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ComboBox and Today's Date 1

Status
Not open for further replies.

xlhelp

Instructor
Dec 7, 2001
2,976
CA
I have a combox that's tied to a table with values 1 through 31.

I would like the default value in the combobox to be today.

I have searched this forum and Google and haven't found an answer that works for me.

Anyhelp would be apprecuated.

Thanks. [pc2]

Me transmitte sursum, Caledoni!
 
PS. The combobox is on a userform

Me transmitte sursum, Caledoni!
 
Hi xlhelp,

Some basics..

What app?
What type of combobox? ActiveX? Forms?
Where is it located? Worksheet? Userform?
What is the range of your data (1-31)?

Regards,
Zack Barresse

Simplicity is the ultimate sophistication. What is a MS MVP? PODA
- Leonardo da Vinci
 
Sorry....

I usually am fairly good at this.

It's Excel, ActiveX. UserForm. Table is in D2:D32, sheet3

Me transmitte sursum, Caledoni!
 



Hi,

By TODAY, do you mean 1, since TODAY is 1/1/2006.

so
Code:
MyCombobox.Value = Day(Date)

Skip,

[glasses] [red][/red]
[tongue]
 
Skip,

That works like a charm. Thanks

Me transmitte sursum, Caledoni!
 
If you already loaded the data, you can use the index as well (it's what I use anyway)..

Code:
Me.ComboBox1.ListIndex = Day(Date) - 1

Regards,
Zack Barresse

Simplicity is the ultimate sophistication. What is a MS MVP? PODA
- Leonardo da Vinci
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top