View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default userform combobox treating numbers as text

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

NickHK

"apndas" wrote in
message ...

hello

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


--
apndas
------------------------------------------------------------------------
apndas's Profile:

http://www.excelforum.com/member.php...o&userid=36137
View this thread: http://www.excelforum.com/showthread...hreadid=562265