Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
LisBox List
Hi,
I am using a user form with a combobox and list box to get certain specific data. Suppose that I am activating the user form from sheet1 and my data in sheet2 what i am doing is.. When i select an item from combobox1 all data related to that item is listed in listbox1. in that process my sheet2 is activated and alldata in it can be seen. is it possible to do this without activating sheet2? From sheet1 the userfom is activated and based on combobox1 value items listed in listbox from sheet2. thanks in advance Abdul |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
LisBox List
you can refer to sheet2 with
Worksheets("Sheet2").Range("A1:A100") for example. This does not activate sheet 2. Avoid code like Sheet2.Activate or Worksheets("Sheet2").Activate Range("A1:A100").Select Or if you can't avoid that, then Application.ScreenUpdating = false ' recorder style code here Worksheets("Sheet2").Select ' more code Worksheets("Sheet1").Select Application.ScreenUpdating = True -- Regards, Tom Ogilvy "Abdul" wrote in message ... Hi, I am using a user form with a combobox and list box to get certain specific data. Suppose that I am activating the user form from sheet1 and my data in sheet2 what i am doing is.. When i select an item from combobox1 all data related to that item is listed in listbox1. in that process my sheet2 is activated and alldata in it can be seen. is it possible to do this without activating sheet2? From sheet1 the userfom is activated and based on combobox1 value items listed in listbox from sheet2. thanks in advance Abdul |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
LisBox List
Abdul
What is the code that you are using to fill listbox1? It should look something like this Private Sub ComboBox1_Change() Dim sh As Worksheet Dim cell As Range Me.ListBox1.Clear Set sh = Sheets("sheet2") For Each cell In sh.Range("a2:a5") If cell.Value = Me.ComboBox1.Value Then Me.ListBox1.AddItem cell.Offset(0, 1).Value End If Next cell End Sub And sheet2 will not be shown. -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. "Abdul" wrote in message ... Hi, I am using a user form with a combobox and list box to get certain specific data. Suppose that I am activating the user form from sheet1 and my data in sheet2 what i am doing is.. When i select an item from combobox1 all data related to that item is listed in listbox1. in that process my sheet2 is activated and alldata in it can be seen. is it possible to do this without activating sheet2? From sheet1 the userfom is activated and based on combobox1 value items listed in listbox from sheet2. thanks in advance Abdul |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Comparing List A to List B and add what's missing from List B | Excel Discussion (Misc queries) | |||
create new list from list A, but with exclusions from a list B | Excel Worksheet Functions | |||
validation list--list depends on the selection of first list | New Users to Excel | |||
list 1 has 400 names List 2 has 4000. find manes from list 1 on 2 | Excel Worksheet Functions | |||
find names on list 1 in list 2. list 1 4000 names list 2 400 name | Excel Worksheet Functions |