userform combobox treating numbers as text

A

apndas

hello

I have created a task planner userform with comboboxes as selectors fo
week numbers. I have set the condition that the target completion wee
combobox value must be greater than the start date combobox - howeve
the combobox is treating the week numbers as text and therefore wee
*1*2 is saying it is smaller than week 8 - I would assume that I woul
have to set the format of the comboboxes in Userform Initialise sub t
number format - can anyone tell me how I would do this
 
N

NickHK

All values in combo/list/text boxes are text.
If you require numerical comparison, coerce to numbers first:
If CLng(cboStartWeek.Value) > ....

NickHK
 

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