+ Reply to Thread
Results 1 to 3 of 3

Select multiple options from drop down list

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-16-2015
    Location
    Aberdeen, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    121

    Select multiple options from drop down list

    Hi

    Not sure if this is possible or if it requires VBA which I am not familiar with.

    I want to have a drop list in a cell that I can select more than one item which will display in the same cell can this be done?

    I would appreciate any guidance in the right direction.

    Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365 Version 2501 64-bit
    Posts
    1,465

    Re: Select multiple options from drop down list

    Forestview,

    Attached code from Contextures Inc. lets you choose item from dropliat, then choose subsequent items which are added to cell separated by commas.
    Includes oprion to use a line break instead of a comma.

    
    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 = 1 Then
        If oldVal = "" Then
          'do nothing
          Else
          If newVal = "" Then
          'do nothing
          Else
          Target.Value = oldVal _
            & ", " & newVal
    '      NOTE: you can use a line break instead of a comma
    '      Target.Value = oldVal& Chr(10) & newVal
          End If
        End If
      End If
    End If
    
    ExitHandler:
      Application.EnableEvents = True
    
    End Sub
    Hope this helps

    Ochimus
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    07-16-2015
    Location
    Aberdeen, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Select multiple options from drop down list

    Hi Ochimus

    It only seems to select and replace the numbers as would happen with a Validation List doesn't do as stated in point 4!

    Am I missing something?

+ 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. Select multiple options from drop down list
    By nsprasad in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-29-2015, 05:30 AM
  2. [SOLVED] Printing Multiple Options from a Drop-Down List
    By JayPear in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-08-2014, 10:07 PM
  3. Replies: 0
    Last Post: 04-22-2014, 11:03 PM
  4. Select Multiple Items From Drop Down List
    By Niclal in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-21-2014, 01:43 PM
  5. Multiple select drop down list
    By boc_est1986 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-14-2009, 08:07 AM
  6. Replies: 5
    Last Post: 10-27-2005, 01:55 PM

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