Hello.
Please, do you know if Listbox can contain also data formated as numbers ? I read somewhere that Listbox in useform is only for text and not numbers. Thus despite I can add to listbox numbers, their format is not NUMBER but TEXT. I just want to use my numbers in listbox as filter criteria. So user select from listbox, let's say 5, and my column will be sorted only on cells containing number 5. I can use this method for TEXTs (strings), but for numbers, it's not working. Excel somehow treat with numbers in litsbox as text. Basically It's working, but only when I setup format of data in my filtering column as GENERAL. But when I want to setup number format of related cells to let's say "number with 2 decimals", then it's not working.
I tried to change data type of my listbox value, like: Val(my_userform.listbox1.value) or Cdec(my_userform.listbox1.value) or
Cint(my_userform.listbox1.value) , but no success. It's like I can't change format of data in listbox to NUMBER.
If you have some idea how can be data in listbox changed to NUMBER format, so I can work with it further (in my case to setup as criteria to filter column containing numbers), I would be very thankful to you. When I write it to textbox, it's working well, but not in Listbox.
Bookmarks