Compare rowsources

K

King

Last question;

I have two comboboxes. The first has a rowsource from a named range of
dates. I want to populate the second rowsource when a date is chosen in the
first one. I only want to show dates greater than the first in the second.
I am assuming I want to use a for each to compare values, but I am stumped:

Dim CheckDate as ?

Combobox2.rowsource=""

For Each CheckDate in (namedrange)
if CheckDate > Combobox1.value then
combobox2.additem CheckDate
end if
next CheckDate


Any suggestions? Thanks!
 
T

Tom Ogilvy

Dim CheckDate as Range

Combobox2.rowsource=""
Combobox2.Clear
For Each CheckDate in Range("DateRange")
If CheckDate.Value2 > cLng(Combobox1.value) then
combobox2.additem format(CheckDate.Value,"m/d/yyyy")
end if
next CheckDate
 

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