ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Date selector combobox (https://www.excelbanter.com/excel-programming/420219-date-selector-combobox.html)

Steve P[_2_]

Date selector combobox
 
Hello Excel gurus...

I am building a userform that will be used to drive a search engine for a
project I'm working on. I have two comboboxes on the form and want the two
comboboxes to be used to select a "start" date and a "end" date to select a
user specified date range. What is the best way to accomplish this?

Dave Peterson

Date selector combobox
 
If the dates that the user can choose are known, you could add the dates when
you load the userform:

Option Explicit
Private Sub Userform_Initialize()
dim myDate as date
for mydate = dateserial(2008,1,1) to dateserial(2008,2,12)
me.combobox1.additem format(mydate,"mmmm dd, yyyy")
next mydate
end sub

But if there are lots and lots of dates, this becomes a pain for the user to
find the correct date to choose.

You may want to consider using a calendar control.

Ron de Bruin has some notes:
http://www.rondebruin.nl/calendar.htm

Or even 3 different controls (day, month, year) for each date.

Steve P wrote:

Hello Excel gurus...

I am building a userform that will be used to drive a search engine for a
project I'm working on. I have two comboboxes on the form and want the two
comboboxes to be used to select a "start" date and a "end" date to select a
user specified date range. What is the best way to accomplish this?


--

Dave Peterson

Mike

Date selector combobox
 
There are Calendar controls you can use on your form.

"Steve P" wrote:

Hello Excel gurus...

I am building a userform that will be used to drive a search engine for a
project I'm working on. I have two comboboxes on the form and want the two
comboboxes to be used to select a "start" date and a "end" date to select a
user specified date range. What is the best way to accomplish this?



All times are GMT +1. The time now is 01:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com