Combobox with current date

B

bbussoloti

Hi,
I have 3 combo boxes that corresponds to day, month and year. When the user
opens my form, those values should be automatically with the current day,
current month and current year, but also open to change it.
I can make the values to be changeable, but i can´t set those current date
values.
I tried with no success all of those below:

With insereForm
.Show
.ComboDay1.Value = Format(Now, "dd")
.ComboDay1.Value = Format(Date,"dd")
.ComboDay1.Value = Day
End With
 
B

bbussoloti

..ComboDay1.Value = Day(Now) doesn´t work either. I even tried to set the
focus first, but no good.



"Rick Rothstein (MVP - VB)" escreveu:
 
R

Rick Rothstein \(MVP - VB\)

Exactly what is the ComboBox populated with and how did you populate it? And
which ComboBox are we talking about... on the worksheet from the Forms
Toolbar, on the worksheet from the Control Toolbar or on a UserForm from
within VBA?

Rick
 
P

perjessen69

.ComboDay1.Value = Day(Now) doesn´t work either. I even tried to set the
focus first, but no good.

"Rick Rothstein (MVP - VB)" escreveu:





- Vis tekst i anførselstegn -

Try

.ComboDay1.AddItem Day(Now)

Regards

Per
 
S

SAPkannan

Hi,

Try this one hopes it works

ComboBox1.Value = Format(Now, "dd")
ComboBox2.Value = Format(Now, "mm")
ComboBox3.Value = Format(Now, "yyyy")
 

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

Excel Vba to change displayed year automatically. 14
Converting a String into a date format 3
Vba Date$ 1
Userform Calendar - Current Date 1
Date Variable 6
Today's Date 1
Check that date exists 1
DTPicker control - Initial date 1

Top