Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 11-20-2019, 09:25 AM
p45cal's Avatar
p45cal p45cal is offline Minor Problem with List Box Selection Windows 10 Minor Problem with List Box Selection Office 2019
Expert
 
Join Date: Apr 2014
Posts: 963
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

try:
Code:
Dim Blocked As Boolean 'this line should be outside the macro and at the top of the code-module.

Private Sub ListBox1_Click()
If Blocked Then Exit Sub
With Me.ListBox1
  If .ListIndex > -1 Then
  Blocked = True
    Cells(Rows.Count, "C").End(xlUp).Offset(1).Value = .Value
    .MultiSelect = fmMultiSelectMulti
   .Selected(.ListIndex) = False
    .MultiSelect = fmMultiSelectSingle
  End If
End With
Blocked = False
End Sub
This could be in the _change event instead, but not both.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mutliple Selection List Box tbrynard01 Word 0 09-10-2019 12:56 PM
Minor Problem with List Box Selection Multiple Selection Dropdown list ajanson Word VBA 36 07-15-2019 08:16 PM
Multiple-Selection List in Word 2016 jamboersma Word 1 05-24-2018 06:44 PM
block selection in dropdown list Intruder Excel 2 01-10-2013 10:20 AM
How do you add to a selection list? bryanarn Excel 2 03-05-2012 05:04 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:47 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft