ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   userform combobox treating numbers as text (https://www.excelbanter.com/excel-programming/367476-userform-combobox-treating-numbers-text.html)

apndas[_5_]

userform combobox treating numbers as text
 

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

--
apnda
-----------------------------------------------------------------------
apndas's Profile: http://www.excelforum.com/member.php...fo&userid=3613
View this thread: http://www.excelforum.com/showthread.php?threadid=56226


NickHK

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




apndas[_6_]

userform combobox treating numbers as text
 

Thanks Nick

Appreciate your help

Regards
darren


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



All times are GMT +1. The time now is 11:13 AM.

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