Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Can you make it so you choose more than one item from a drop down

I have copied the code which makes it possible to choose more than one item
from a dropdown list in excel. Something Im not clear on is, once the code
is copied to the worksheet is that ability to pick more than one variable
from a list valid for every column in the worksheet of just one column? I
copied the code and it is only working for the column which was highlighted
when I pasted the code. I need this to work for all my dropdown list within
a single worksheet. Any help is so appreciated!!!!!!!!



  #2   Report Post  
Posted to microsoft.public.excel.programming
Tim Tim is offline
external usenet poster
 
Posts: 145
Default Can you make it so you choose more than one item from a drop down



"LTaylor" wrote in message
...
I have copied the code which makes it possible to choose more than one item


What code ?

Tim


from a dropdown list in excel. Something I'm not clear on is, once the
code
is copied to the worksheet is that ability to pick more than one variable
from a list valid for every column in the worksheet of just one column? I
copied the code and it is only working for the column which was
highlighted
when I pasted the code. I need this to work for all my dropdown list
within
a single worksheet. Any help is so appreciated!!!!!!!!





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Can you make it so you choose more than one item from a drop down

I doubt anyone knows what you are talking about. Post the code that you
claim allows you to do this. Also say what kind of dropdown you are using.

--
Regards,
Tom Ogilvy


"LTaylor" wrote:

I have copied the code which makes it possible to choose more than one item
from a dropdown list in excel. Something Im not clear on is, once the code
is copied to the worksheet is that ability to pick more than one variable
from a list valid for every column in the worksheet of just one column? I
copied the code and it is only working for the column which was highlighted
when I pasted the code. I need this to work for all my dropdown list within
a single worksheet. Any help is so appreciated!!!!!!!!



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Can you make it so you choose more than one item from a drop d

I'm sorry I'm new at this. This is for a list dropdown. I see that this
code is referencing target.column = 3

When I use this code it does allow more than one choice in column 3 but, how
do I make it reference more than one column? Thank you

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngDV As Range
Dim oldVal As String
Dim newVal As String
If Target.Count 1 Then GoTo exitHandler

On Error Resume Next
Set rngDV = Cells.SpecialCells(xlCellTypeAllValidation)
On Error GoTo exitHandler

If rngDV Is Nothing Then GoTo exitHandler

If Intersect(Target, 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



"Tom Ogilvy" wrote:

I doubt anyone knows what you are talking about. Post the code that you
claim allows you to do this. Also say what kind of dropdown you are using.

--
Regards,
Tom Ogilvy


"LTaylor" wrote:

I have copied the code which makes it possible to choose more than one item
from a dropdown list in excel. Something Im not clear on is, once the code
is copied to the worksheet is that ability to pick more than one variable
from a list valid for every column in the worksheet of just one column? I
copied the code and it is only working for the column which was highlighted
when I pasted the code. I need this to work for all my dropdown list within
a single worksheet. Any help is so appreciated!!!!!!!!



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Can you make it so you choose more than one item from a drop d

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngDV As Range
Dim oldVal As String
Dim newVal As String
If Target.Count 1 Then GoTo exitHandler

On Error Resume Next
Set rngDV = Cells.SpecialCells(xlCellTypeAllValidation)
On Error GoTo exitHandler

If rngDV Is Nothing Then GoTo exitHandler

If Intersect(Target, rngDV) Is Nothing Then
'do nothing
Else
Application.EnableEvents = False
newVal = Target.Value
Application.Undo
oldVal = Target.Value
Target.Value = newVal

' add your criteria for columns here

If Target.Column = 3 or Target.Column = 5 or _
Target.column = 7 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

--
Regards,
Tom Ogilvy

"LTaylor" wrote:

I'm sorry I'm new at this. This is for a list dropdown. I see that this
code is referencing target.column = 3

When I use this code it does allow more than one choice in column 3 but, how
do I make it reference more than one column? Thank you

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngDV As Range
Dim oldVal As String
Dim newVal As String
If Target.Count 1 Then GoTo exitHandler

On Error Resume Next
Set rngDV = Cells.SpecialCells(xlCellTypeAllValidation)
On Error GoTo exitHandler

If rngDV Is Nothing Then GoTo exitHandler

If Intersect(Target, 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



"Tom Ogilvy" wrote:

I doubt anyone knows what you are talking about. Post the code that you
claim allows you to do this. Also say what kind of dropdown you are using.

--
Regards,
Tom Ogilvy


"LTaylor" wrote:

I have copied the code which makes it possible to choose more than one item
from a dropdown list in excel. Something Im not clear on is, once the code
is copied to the worksheet is that ability to pick more than one variable
from a list valid for every column in the worksheet of just one column? I
copied the code and it is only working for the column which was highlighted
when I pasted the code. I need this to work for all my dropdown list within
a single worksheet. Any help is so appreciated!!!!!!!!





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Can you make it so you choose more than one item from a drop d

Thank you! You are wonderful.

"Tom Ogilvy" wrote:

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngDV As Range
Dim oldVal As String
Dim newVal As String
If Target.Count 1 Then GoTo exitHandler

On Error Resume Next
Set rngDV = Cells.SpecialCells(xlCellTypeAllValidation)
On Error GoTo exitHandler

If rngDV Is Nothing Then GoTo exitHandler

If Intersect(Target, rngDV) Is Nothing Then
'do nothing
Else
Application.EnableEvents = False
newVal = Target.Value
Application.Undo
oldVal = Target.Value
Target.Value = newVal

' add your criteria for columns here

If Target.Column = 3 or Target.Column = 5 or _
Target.column = 7 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

--
Regards,
Tom Ogilvy

"LTaylor" wrote:

I'm sorry I'm new at this. This is for a list dropdown. I see that this
code is referencing target.column = 3

When I use this code it does allow more than one choice in column 3 but, how
do I make it reference more than one column? Thank you

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngDV As Range
Dim oldVal As String
Dim newVal As String
If Target.Count 1 Then GoTo exitHandler

On Error Resume Next
Set rngDV = Cells.SpecialCells(xlCellTypeAllValidation)
On Error GoTo exitHandler

If rngDV Is Nothing Then GoTo exitHandler

If Intersect(Target, 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



"Tom Ogilvy" wrote:

I doubt anyone knows what you are talking about. Post the code that you
claim allows you to do this. Also say what kind of dropdown you are using.

--
Regards,
Tom Ogilvy


"LTaylor" wrote:

I have copied the code which makes it possible to choose more than one item
from a dropdown list in excel. Something Im not clear on is, once the code
is copied to the worksheet is that ability to pick more than one variable
from a list valid for every column in the worksheet of just one column? I
copied the code and it is only working for the column which was highlighted
when I pasted the code. I need this to work for all my dropdown list within
a single worksheet. Any help is so appreciated!!!!!!!!



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
drop down data want to choose more than one item for cell FranW Excel Worksheet Functions 1 February 26th 10 08:44 PM
Can I choose more than one item in the page field area? trainer07 Excel Discussion (Misc queries) 1 April 19th 07 10:22 AM
User to choose an item from a list Hari Excel Programming 4 May 20th 06 06:57 PM
Pivot Item: removing non-existant item from the drop down CinqueTerra Excel Programming 2 February 23rd 06 08:47 PM
Make typing "jump" to matching item(s) in drop-down list? Kathy Excel Discussion (Misc queries) 4 November 22nd 05 10:25 PM


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