Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi !
I try to learn how to write macros in excel. This is my first macro. I have one problem. In a sheet I have few ComboBoxes which have ListFillRange defined as an range of cells in another sheet (in the same Workbook). What i want to do is to check if the current value in ComboBox is a value from the ListFillRange. If not, then it should be corrected. Procedure is: Sub Popraw_Wartosc(X As Object) Dim K As Integer Dim ItFits As Boolean Dim Ilosc As Integer ItFits = False Ilosc = X.ListCount For K = 0 To Ilosc - 1 If X.Value = X.List(K) Then ItFits = True End If Next If ItFits = False Then X.Value = X.List(Ilosc - 1) End If End Sub The problem is, that even if the current value of COmboBox has a correspodning value in X.List, the "ItFits" variable never is true. I try to watch this process, and on some stage I can read that X.Value is lets say 1200, and the X.List(K) is also 1200 , but "ItFits" is still False. What am I missing? Best Regards, m.s.w |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
if any of 3 conditions is true, then answer is true | Excel Worksheet Functions | |||
Search for 2 true arguments and return true or false | Excel Discussion (Misc queries) | |||
Function to return True/False if all are validated as True by ISNU | Excel Worksheet Functions | |||
How do I stop Excel from changing the word true to TRUE? | Excel Discussion (Misc queries) | |||
Reverse false and combine with true true value | Excel Worksheet Functions |