Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Multi Select from Drop List

Good moring, i've researched and found link to sample file below. Was able
to implement. There are some cells however where i do want to allow mutliple
selections from drop down lists and other cells where i do not. Can anyone
tell me how to execute this code while in designated cells only? Thanks.
http://www.contextures.com/excelfiles.html

--
Thank you
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Multi Select from Drop List

Assuming you are working with Debra's workbook DataValMultiSelect.xls and
sheet named "SameCell" with DV dropdowns in C3:C7

Revised event code to allow multiselection in cells C6 and C7 only. Adjust
to suit.

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Const rngDV As String = "C3:C5"
Dim oldVal As String
Dim newVal As String
If Target.Count 1 Then GoTo exitHandler

On Error Resume Next
On Error GoTo exitHandler
If Range(rngDV) Is Nothing Then GoTo exitHandler
If Not Intersect(Target, Range(rngDV)) Is Nothing Then
'do nothing
Else
Application.EnableEvents = False
newVal = Target.Value
Application.Undo
oldVal = Target.Value
Target.Value = newVal
If Target.Column = 3 Then
If oldVal = "" Then
'do nothing
Else
If newVal = "" Then
'do nothing
Else
Target.Value = oldVal _
& ", " & newVal
End If
End If
End If
End If

exitHandler:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP



On Tue, 8 Sep 2009 04:55:02 -0700, PatriciaT
wrote:

Good moring, i've researched and found link to sample file below. Was able
to implement. There are some cells however where i do want to allow mutliple
selections from drop down lists and other cells where i do not. Can anyone
tell me how to execute this code while in designated cells only? Thanks.
http://www.contextures.com/excelfiles.html


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Multi Select from Drop List

Thank you. I'll give it a try.


"Gord Dibben" wrote:

Assuming you are working with Debra's workbook DataValMultiSelect.xls and
sheet named "SameCell" with DV dropdowns in C3:C7

Revised event code to allow multiselection in cells C6 and C7 only. Adjust
to suit.

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Const rngDV As String = "C3:C5"
Dim oldVal As String
Dim newVal As String
If Target.Count 1 Then GoTo exitHandler

On Error Resume Next
On Error GoTo exitHandler
If Range(rngDV) Is Nothing Then GoTo exitHandler
If Not Intersect(Target, Range(rngDV)) Is Nothing Then
'do nothing
Else
Application.EnableEvents = False
newVal = Target.Value
Application.Undo
oldVal = Target.Value
Target.Value = newVal
If Target.Column = 3 Then
If oldVal = "" Then
'do nothing
Else
If newVal = "" Then
'do nothing
Else
Target.Value = oldVal _
& ", " & newVal
End If
End If
End If
End If

exitHandler:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP



On Tue, 8 Sep 2009 04:55:02 -0700, PatriciaT
wrote:

Good moring, i've researched and found link to sample file below. Was able
to implement. There are some cells however where i do want to allow mutliple
selections from drop down lists and other cells where i do not. Can anyone
tell me how to execute this code while in designated cells only? Thanks.
http://www.contextures.com/excelfiles.html



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
Is it possible to select a multi value from a drop down box Carrie Excel Discussion (Misc queries) 12 June 10th 09 08:10 PM
Multi-select from drop down list in Excel 97 arpgis Excel Discussion (Misc queries) 1 April 11th 07 10:46 PM
how do I select multi values from a list Tommy Excel Discussion (Misc queries) 1 July 12th 06 09:38 AM
How to Select multi from drop down (field buttons) Bettergains Charts and Charting in Excel 0 November 24th 05 12:55 AM
List Box Multi Select Option ann_nyc Excel Worksheet Functions 0 October 11th 05 05:56 PM


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