+ Reply to Thread
Results 1 to 2 of 2

Multiple Choice List not working as expected

  1. #1
    Registered User
    Join Date
    01-22-2014
    Location
    Pretoria, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    58

    Multiple Choice List not working as expected

    Dear Forum Members,

    I am trying to set up a multiple choice list in a specific cell in an Excel 2010 workbook. I found the instructions on the Contextures Website. I followed the steps to set up the named range list, set up the data validation to enable the drop down, then copied the code below and pasted it into my worksheet as instructed. I changed the column number and I saved the workbook as a macro-enabled workbook.

    When I tested the drop down, it did not allow me to make multiple choices. What am I missing?

    The code is
    Option Explicit
    ' Developed by Contextures Inc.
    ' www.contextures.com
    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 = 16 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

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Multiple Choice List not working as expected

    Unfortunately your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Multiple Time Stamps depending on choice in Drop Down List Choice
    By insayah in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-25-2022, 09:53 AM
  2. [SOLVED] VBA Dynamic Validation List Entry Not Working As Expected
    By acerzw in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-27-2013, 04:52 PM
  3. Multiple Choice from List Box
    By alis88 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-10-2008, 02:09 PM
  4. [SOLVED] [SOLVED] How do i create a multiple choice drop down list
    By Piper in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 09-07-2005, 08:05 PM
  5. Dropdown list/Multiple choice??
    By KDD in forum Excel General
    Replies: 2
    Last Post: 08-30-2005, 05:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1