input box default values (current month, year)

G

Guest

am using two inboxes to query user to input a month and then a year. would
like the default values to be the current month and year, i.e., 6 for june,
and 2007 for year. how can i do this? (just asking for vba for "default"
argument)
 
V

Vasant Nanavati

I'm assuming you mean InputBoxes.

Application.InputBox "Enter Month No.","Month", Month(Now), , , , , 1
Application.InputBox "Enter Year","Year", Year(Now), , , , , 1

_________________________________________________________________________
 
C

Corey

Dim res As Variant
res = InputBox("What is the Year ?", , "2007")
Sheet1.Range("A1") = res

am using two inboxes to query user to input a month and then a year. would
like the default values to be the current month and year, i.e., 6 for june,
and 2007 for year. how can i do this? (just asking for vba for "default"
argument)
 
V

Vasant Nanavati

This won't work next year. :)
________________________________________________________________________
 
V

Vasant Nanavati

You're most welcome. :)
________________________________________________________________________
 

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

Top