![]() |
#1
|
|||
|
|||
![]()
I have created two list boxes in word VBA. The first Listbox1 when an item is selected it will add an item to the second list box.
The second list box should then use that value as a bookmark. The error I get is that Listbox2 shows the text but not the value. So when I refer to that Listbox2 is states "ListBox2.value = "" (null or nothing). How do I get this value? Here is the bit of code that I wrote. Private Sub ListBox2_Enter() Dim sMyStr As String sMyStr = Me.ListBox1.Value If sMyStr = "P21" Then ListBox2.AddItem "41" ElseIf sMyStr = "P69" Then ListBox2.AddItem "31" ElseIf sMyStr = "P62" Then ListBox2.AddItem "11" ElseIf sMyStr = "P64" Then ListBox2.AddItem "42" Else ListBox2 = "" End Sub Many thanks in advance for any assistance. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to filter data before it is pulled into combobox/listbox AND remove data from listbox | Izzii0x | Excel Programming | 8 | 05-24-2019 07:25 AM |
Combine rows in one where other column is not null | Hanna | Excel | 0 | 04-28-2017 07:31 AM |
Help with Invalid Use of Null Error | electronicpizza | Word VBA | 3 | 12-15-2014 02:15 AM |
This is a Userform LIstbox queston: A variable does not set to the value of a listbox | CatMan | Excel Programming | 14 | 08-18-2014 08:14 PM |
![]() |
CatMan | Excel | 1 | 08-08-2014 09:41 AM |