Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default List box deselect

That's perfect! Thank you

"Dave Peterson" wrote:

Is this a listbox from the control toolbox toolbar that's on a worksheet?

If yes, then you have code associated with that listbox that updates that range
-- and it sounds like you have trouble with that code.

I put a listbox from that control toolbox toolbar on a worksheet and wanted to
put all the values for the indexes in B1, B2, .... for each item selected.

This is the code I used in behind that listbox:

Option Explicit
Private Sub ListBox1_Change()

Dim iCtr As Long
Dim DestCell As Range
Dim HowMany As Long

HowMany = Me.ListBox1.ListCount

Set DestCell = Me.Range("B1")
DestCell.Resize(HowMany).ClearContents

With Me.ListBox1
For iCtr = 0 To .ListCount - 1
If .Selected(iCtr) Then
DestCell.Value = iCtr '+1
'get the value, too???
DestCell.Offset(0, 1).Value = .List(iCtr)
'get ready for next item
Set DestCell = DestCell.Offset(1, 0)
End If
Next iCtr
End With

End Sub



comparini3000 wrote:

I have a list box (fmMultiSelectExtended) to display selections (by numeric
code) in a range of cells. However, when I deselect an option, the
corresponding number does not delete itself from the output list. The reason
why this is so important is because I have a lookup function setup in another
range that tells the user the choices they have made (this is because there
are many choices and it would take too long to scroll and look back at
everything). How can I update the list box output range to reflect
deselection?
Thank you,

comparini3000


--

Dave Peterson

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
select all, deselect these md[_2_] Excel Discussion (Misc queries) 1 March 2nd 08 03:08 PM
.SeriesCollection(2).Name and .Deselect Peter Sie Charts and Charting in Excel 2 July 3rd 06 03:10 AM
deselect rows Pam C Excel Discussion (Misc queries) 1 February 16th 06 09:39 PM
ActiveChart.Deselect won't Deselect Mark Stephens Charts and Charting in Excel 2 June 16th 05 02:54 AM
Deselect of Cells Handler Robert[_3_] Excel Programming 4 February 18th 04 01:20 PM


All times are GMT +1. The time now is 09:30 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"