#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 179
Default 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
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
Comparing List A to List B and add what's missing from List B Gilbert Excel Discussion (Misc queries) 1 July 20th 09 08:41 PM
create new list from list A, but with exclusions from a list B Harold Good Excel Worksheet Functions 3 April 11th 08 11:23 PM
validation list--list depends on the selection of first list Michael New Users to Excel 2 April 27th 06 10:23 PM
list 1 has 400 names List 2 has 4000. find manes from list 1 on 2 Ed Excel Worksheet Functions 5 September 12th 05 09:48 AM
find names on list 1 in list 2. list 1 4000 names list 2 400 name Ed Excel Worksheet Functions 1 September 4th 05 12:48 AM


All times are GMT +1. The time now is 11:09 AM.

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"