Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Choosing Multiple items from Data Validation Lists

I have the following code that allows users to pick multiple choices from a
data validation list. The problem with the code is that users can pick
multiple choices from all the lists in the worksheet and not just F, J, V, O.
How can I change this to only allow users to choose multiple items in those
columns? Thanks.

If Application.Intersect(Target, Range("F2:F25,U2:U25,V2:V25,02:025")) Is
Nothing Then Exit Sub

For Each cell In Target
Application.EnableEvents = False
On Error GoTo exitHandler
newVal = cell.Value
Application.Undo
oldVal = cell.Value
cell.Value = newVal

If oldVal = "" Then
'do nothing
Else
If newVal = "" Then
'do nothing
Else
cell.Value = oldVal _
& ";# " & newVal
End If
End If



Next cell

exitHandler:
Application.EnableEvents = True

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Choosing Multiple items from Data Validation Lists

Hi Alex,

"Alex" schrieb:
I have the following code that allows users to pick multiple choices from a
data validation list. The problem with the code is that users can pick
multiple choices from all the lists in the worksheet and not just F, J, V, O.
How can I change this to only allow users to choose multiple items in those
columns? Thanks.

If Application.Intersect(Target, Range("F2:F25,U2:U25,V2:V25,02:025")) Is
Nothing Then Exit Sub


in the Range 02:025 you use the number 0 instead of the letter O.
This should work for you:

If Application.Intersect(Target, Range("F2:F25,U2:U25,V2:V25,O2:O25")) _
Is Nothing Then Exit Sub


Mit freundlichen Grüssen
Melanie Breden

- Microsoft MVP für Excel -

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Choosing Multiple items from Data Validation Lists

You are correct. Thank you very much for catching my oversight!

"Melanie Breden" wrote:

Hi Alex,

"Alex" schrieb:
I have the following code that allows users to pick multiple choices from a
data validation list. The problem with the code is that users can pick
multiple choices from all the lists in the worksheet and not just F, J, V, O.
How can I change this to only allow users to choose multiple items in those
columns? Thanks.

If Application.Intersect(Target, Range("F2:F25,U2:U25,V2:V25,02:025")) Is
Nothing Then Exit Sub


in the Range 02:025 you use the number 0 instead of the letter O.
This should work for you:

If Application.Intersect(Target, Range("F2:F25,U2:U25,V2:V25,O2:O25")) _
Is Nothing Then Exit Sub


Mit freundlichen Grüssen
Melanie Breden

- Microsoft MVP für Excel -

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
pick multiple items in data validation Grd Excel Discussion (Misc queries) 2 March 18th 10 07:55 PM
Choosing multiple items in a drop down list Shad Excel Discussion (Misc queries) 9 July 7th 08 06:38 PM
data validation from multiple lists dkingston Excel Programming 8 December 3rd 06 09:28 PM
Choosing multiple items in a dropdown menu [email protected] Excel Programming 3 November 7th 06 09:11 AM
Printing Multiple Data Validation Lists MWS Excel Worksheet Functions 5 March 28th 06 11:34 PM


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