Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default List Box Select All Values

Hi there,

I have a listbox control on my sheet
Its ListStyle = 1 - fmListStyleOption and it has got 5 items in it as flllows:

All
Red
Green
Blue
Orange

When i select 'All' (the first item) it should select all the items in the
list box.
Can anyone suggest anything on this please?
Thanking in advance.
Vipul Agheda
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default List Box Select All Values

Change the property Multiselect

from
fmMultoSelectSingle
to
fmMultiSelectMulti

"Vipul" wrote:

Hi there,

I have a listbox control on my sheet
Its ListStyle = 1 - fmListStyleOption and it has got 5 items in it as flllows:

All
Red
Green
Blue
Orange

When i select 'All' (the first item) it should select all the items in the
list box.
Can anyone suggest anything on this please?
Thanking in advance.
Vipul Agheda

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default List Box Select All Values

thanks for replying Joel

MultiSelect property is already fmMultiSelectMulti

i want all the items to be selected automatically when i select only the
first one.
i want to know how can i do it.

can u help with this?
thanks buddy
Vipul


"Joel" wrote:

Change the property Multiselect

from
fmMultoSelectSingle
to
fmMultiSelectMulti

"Vipul" wrote:

Hi there,

I have a listbox control on my sheet
Its ListStyle = 1 - fmListStyleOption and it has got 5 items in it as flllows:

All
Red
Green
Blue
Orange

When i select 'All' (the first item) it should select all the items in the
list box.
Can anyone suggest anything on this please?
Thanking in advance.
Vipul Agheda

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default List Box Select All Values

Hi,

Paste this code into the sheets code module.

'------------------------
Private m_blnUpdating As Boolean

Private Sub ListBox1_Change()

Dim lngIndex As Long

If m_blnUpdating Then Exit Sub

If ListBox1.ListIndex = 0 Then
If ListBox1.Selected(0) Then
m_blnUpdating = True
For lngIndex = 1 To ListBox1.ListCount - 1
ListBox1.Selected(lngIndex) = True
Next
m_blnUpdating = False
End If
End If

End Sub
'------------------------


Cheers
Andy
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Vipul" wrote in message
...
Hi there,

I have a listbox control on my sheet
Its ListStyle = 1 - fmListStyleOption and it has got 5 items in it as
flllows:

All
Red
Green
Blue
Orange

When i select 'All' (the first item) it should select all the items in the
list box.
Can anyone suggest anything on this please?
Thanking in advance.
Vipul Agheda


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default List Box Select All Values

What is the purpose? Is it for the user to see all the cells selected? A
macro can read all the cells in the box so I'm not sure what your intentions
are. Also how is yu code going to work. Are you going to use a ONClick
routine or is your code going to operate when the user presses a control
button?

"Vipul" wrote:

thanks for replying Joel

MultiSelect property is already fmMultiSelectMulti

i want all the items to be selected automatically when i select only the
first one.
i want to know how can i do it.

can u help with this?
thanks buddy
Vipul


"Joel" wrote:

Change the property Multiselect

from
fmMultoSelectSingle
to
fmMultiSelectMulti

"Vipul" wrote:

Hi there,

I have a listbox control on my sheet
Its ListStyle = 1 - fmListStyleOption and it has got 5 items in it as flllows:

All
Red
Green
Blue
Orange

When i select 'All' (the first item) it should select all the items in the
list box.
Can anyone suggest anything on this please?
Thanking in advance.
Vipul Agheda

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
how do I select multi values from a list Tommy Excel Discussion (Misc queries) 1 July 12th 06 09:38 AM
What function to select the last 3 small values from a list ? Eric Excel Discussion (Misc queries) 7 December 31st 05 12:14 PM
What function to select the last 3 small values from a list ? Eric Excel Worksheet Functions 2 December 31st 05 08:02 AM
Auto Select from list of values Hippy Excel Programming 2 November 1st 05 06:41 PM
Select values from list Bepi Excel Discussion (Misc queries) 2 June 21st 05 11:07 AM


All times are GMT +1. The time now is 03:49 PM.

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

About Us

"It's about Microsoft Excel"