Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default Listbox 2 takes the value of Listbox 1

Hi, I have an excel sheet with two listboxes controlled by forms. The
listboxes are populated from different data and when clicked populate
information in Sheet1. Listbox1 has 20 rows of data, Listbox2 has 10 rows.
When the first listbox pops up I can select any of the entries. If I select
row 2 the data is populated in the correct place in sheet1. The second
listbox doesn't show up but the data from row 2 of the second list box is
automatically populated in the correct place in sheet1. If I run this again
and pick row 11 in listbox1 the second list box shows up and everything works
correctly. The second listbox appears to be picking up the value from the
first listbox and only shows up if that number doesn't correspond to
anything. Any ideas on how to fix that?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 663
Default Listbox 2 takes the value of Listbox 1

Hi,

Excel -- Data Validation -- Create Dependent Lists.

Use this URL: http://www.contextures.com/xlDataVal02.html

Challa Prabhu


"Illya Teideman" wrote:

Hi, I have an excel sheet with two listboxes controlled by forms. The
listboxes are populated from different data and when clicked populate
information in Sheet1. Listbox1 has 20 rows of data, Listbox2 has 10 rows.
When the first listbox pops up I can select any of the entries. If I select
row 2 the data is populated in the correct place in sheet1. The second
listbox doesn't show up but the data from row 2 of the second list box is
automatically populated in the correct place in sheet1. If I run this again
and pick row 11 in listbox1 the second list box shows up and everything works
correctly. The second listbox appears to be picking up the value from the
first listbox and only shows up if that number doesn't correspond to
anything. Any ideas on how to fix that?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default Listbox 2 takes the value of Listbox 1

Thanks for the thought, However I'm using listboxes from forms.
Dropdown lists are unfortunately not suitable for what I am doing.

"challa prabhu" wrote:

Hi,

Excel -- Data Validation -- Create Dependent Lists.

Use this URL: http://www.contextures.com/xlDataVal02.html

Challa Prabhu


"Illya Teideman" wrote:

Hi, I have an excel sheet with two listboxes controlled by forms. The
listboxes are populated from different data and when clicked populate
information in Sheet1. Listbox1 has 20 rows of data, Listbox2 has 10 rows.
When the first listbox pops up I can select any of the entries. If I select
row 2 the data is populated in the correct place in sheet1. The second
listbox doesn't show up but the data from row 2 of the second list box is
automatically populated in the correct place in sheet1. If I run this again
and pick row 11 in listbox1 the second list box shows up and everything works
correctly. The second listbox appears to be picking up the value from the
first listbox and only shows up if that number doesn't correspond to
anything. Any ideas on how to fix that?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default Listbox 2 takes the value of Listbox 1

I have found a workaround. By putting a message box at the end of listbox2
everything works correctly. The extra click seems to stop the next listbox
from running automatically. I still have no idea why this is happening so any
further ideas would be greatfully received. (At least I have a quick and
dirty workaround for now)

--Listbox1
Private Sub ListBox1_Click()
ActiveSheet.Range("B2") = ListBox1.List(ListBox1.Value, 0) & " " &
ListBox1.List(ListBox1.Value, 1)
MsgBox "test"
Unload Me
End Sub

--Listbox2
Private Sub ListBox2_Click()
ActiveSheet.Range("B3") = ListBox1.List(ListBox1.Value, 0) & " " &
ListBox1.List(ListBox1.Value, 1)
Unload Me
End Sub


"Illya Teideman" wrote:

Hi, I have an excel sheet with two listboxes controlled by forms. The
listboxes are populated from different data and when clicked populate
information in Sheet1. Listbox1 has 20 rows of data, Listbox2 has 10 rows.
When the first listbox pops up I can select any of the entries. If I select
row 2 the data is populated in the correct place in sheet1. The second
listbox doesn't show up but the data from row 2 of the second list box is
automatically populated in the correct place in sheet1. If I run this again
and pick row 11 in listbox1 the second list box shows up and everything works
correctly. The second listbox appears to be picking up the value from the
first listbox and only shows up if that number doesn't correspond to
anything. Any ideas on how to fix that?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
listbox B conditional of input in Listbox A Kim K Excel Discussion (Misc queries) 1 October 31st 06 09:27 PM
Listbox B if LIstbox A equals Kim K Excel Discussion (Misc queries) 2 October 31st 06 08:03 PM
MSOffice Excel 2003-Validation Listbox takes only 47 values Keryun Excel Worksheet Functions 4 February 2nd 06 07:02 PM
Listbox Greg B Excel Discussion (Misc queries) 1 March 9th 05 03:18 PM
ListBox (maybe?) ... If so, how? Ken Excel Discussion (Misc queries) 3 December 15th 04 11:16 PM


All times are GMT +1. The time now is 10:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"