Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]() I am working on a project in which one list box will populate the next through vlookups. The only problem is that if you change one of the boxes previous to another it does not clear them therefore they contain false values. Any ideas on how to make the boxes clear when selecting any of the previous boxes? -- Kevin Willhoit ------------------------------------------------------------------------ Kevin Willhoit's Profile: http://www.excelforum.com/member.php...o&userid=24413 View this thread: http://www.excelforum.com/showthread...hreadid=380122 |
#2
![]() |
|||
|
|||
![]()
Hi
I don't know! But I can suggest you take a look he http://www.contextures.com/xlDataVal02.html Sorry I can't be more help, but the above may point you in the right direction. Sorry, too, if you've already tried Debra's site. Cheers. -- Andy. "Kevin Willhoit" <Kevin.Willhoit.1qs32c_1119024305.2233@excelforu m-nospam.com wrote in message news:Kevin.Willhoit.1qs32c_1119024305.2233@excelfo rum-nospam.com... I am working on a project in which one list box will populate the next through vlookups. The only problem is that if you change one of the boxes previous to another it does not clear them therefore they contain false values. Any ideas on how to make the boxes clear when selecting any of the previous boxes? -- Kevin Willhoit ------------------------------------------------------------------------ Kevin Willhoit's Profile: http://www.excelforum.com/member.php...o&userid=24413 View this thread: http://www.excelforum.com/showthread...hreadid=380122 |
#3
![]() |
|||
|
|||
![]()
I wasn't sure how you were using the listboxes and how you were using the
=vlookup()'s. But I put 3 listboxes on a userform (listbox1, listbox2, and listbox3). Listbox1 controls listbox2 which controls listbox3. This is the code I had behind the userform: Option Explicit Dim blkProc As Boolean Private Sub ListBox1_Change() Dim iCtr As Long Dim myChar As String blkProc = True Me.ListBox2.Clear Me.ListBox3.Clear blkProc = False If Me.ListBox1.Value = "a1" Then myChar = "x" Else myChar = "y" End If For iCtr = 1 To 10 Me.ListBox2.AddItem myChar & iCtr Next iCtr End Sub Private Sub ListBox2_Change() Dim iCtr As Long Dim myChar As String If blkProc = True Then Exit Sub blkProc = True Me.ListBox3.Clear blkProc = False If Me.ListBox2.Value = "x1" Then myChar = "z" Else myChar = "w" End If For iCtr = 1 To 10 Me.ListBox3.AddItem myChar & iCtr Next iCtr End Sub Private Sub ListBox3_Change() If blkProc = True Then Exit Sub MsgBox "hi" End Sub Private Sub UserForm_Initialize() Dim iCtr As Long For iCtr = 1 To 10 Me.ListBox1.AddItem "a" & iCtr Next iCtr End Sub So if you go an change a previous listbox, then the "trailing" listboxes are reset or reinitialized. Maybe it'll help? Kevin Willhoit wrote: I am working on a project in which one list box will populate the next through vlookups. The only problem is that if you change one of the boxes previous to another it does not clear them therefore they contain false values. Any ideas on how to make the boxes clear when selecting any of the previous boxes? -- Kevin Willhoit ------------------------------------------------------------------------ Kevin Willhoit's Profile: http://www.excelforum.com/member.php...o&userid=24413 View this thread: http://www.excelforum.com/showthread...hreadid=380122 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Data Validation list boxes | Excel Discussion (Misc queries) | |||
Clearing Check Boxes and Cells | Excel Discussion (Misc queries) | |||
Clearing Check Boxes and Cells | Excel Discussion (Misc queries) | |||
Clearing Check Boxes and Cells | Excel Worksheet Functions | |||
Using symbols for drop down list boxes? | Excel Worksheet Functions |