Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
My userform has a combo box. When I refer to "userform.cbx1.value", I
sometimes get "Null". It's inconsistent, because sometimes I get the value selected from the list. It's just a basic (2-columned) combo box. Any ideas why I get "Null"? TIA |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One main reason why you may get null, there is nothing at all in the cell.
There's a difference between a Null (which means undefined) and an empty string, which is define as a string with nothing in it, but still returns the empty string (""). One example of why you may want this distinction would be dealing with appartment numbers. Say one of your customers lives in an apartment complex, however, the apartment number for whatever wasn't captured. Do you put in the textbox as an empty string or do you leave it as undefined. In this case, it would be left as undefined cause that piece of information isn't known. Now, another customer owns and lives in a house, and there is no one else that lives in the home other than those that lives with that same person as one household unit. In that cause, you know that customer doesn't have an apartment unit within the house, so the value of the textbox in that case would be the empty string to indicate there is no apartment number. Now, how can you test for this null value if the value is null? Answer, use the IsNull Function as the condition of an If...Then[...ElseIf][...Else]...End If statement. Hope this has helped in clearing up your issue. -- Ronald R. Dodge, Jr. Production Statistician Master MOUS 2000 "zsplash" wrote in message ... My userform has a combo box. When I refer to "userform.cbx1.value", I sometimes get "Null". It's inconsistent, because sometimes I get the value selected from the list. It's just a basic (2-columned) combo box. Any ideas why I get "Null"? TIA |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you, Ron. That explanation helps. I think the problem has to do with
my using Row Source (to indicate what the combo box is "populated with"), but, then, the combo box doesn't always "get" the list, so turns up null, even though the user has input something. If the current active worksheet is something other than where the Row Source list is located, the combo box has no list-values, and since Match is required, "input" doesn't "match" anything in the Row Source address. (I guess.....) st. "Ronald Dodge" wrote in message ... One main reason why you may get null, there is nothing at all in the cell. There's a difference between a Null (which means undefined) and an empty string, which is define as a string with nothing in it, but still returns the empty string (""). One example of why you may want this distinction would be dealing with appartment numbers. Say one of your customers lives in an apartment complex, however, the apartment number for whatever wasn't captured. Do you put in the textbox as an empty string or do you leave it as undefined. In this case, it would be left as undefined cause that piece of information isn't known. Now, another customer owns and lives in a house, and there is no one else that lives in the home other than those that lives with that same person as one household unit. In that cause, you know that customer doesn't have an apartment unit within the house, so the value of the textbox in that case would be the empty string to indicate there is no apartment number. Now, how can you test for this null value if the value is null? Answer, use the IsNull Function as the condition of an If...Then[...ElseIf][...Else]...End If statement. Hope this has helped in clearing up your issue. -- Ronald R. Dodge, Jr. Production Statistician Master MOUS 2000 "zsplash" wrote in message ... My userform has a combo box. When I refer to "userform.cbx1.value", I sometimes get "Null". It's inconsistent, because sometimes I get the value selected from the list. It's just a basic (2-columned) combo box. Any ideas why I get "Null"? TIA |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Return null | Excel Worksheet Functions | |||
Compare Value in Cell 1 to a List, Return Value if Match otherwise Return Null | Excel Discussion (Misc queries) | |||
Have DGET return Null instead of #Value! | Excel Worksheet Functions | |||
Cell to return null instead of 0 | Excel Discussion (Misc queries) | |||
return a " " for null values | Excel Worksheet Functions |