Forum Discussion
Drop Down Multiple Selection Analysis Pivot Table
Here is a link anyone should be able to have access to and download, to help understand my issue: https://drive.google.com/file/d/1jmLdE10piAyI3eWAojU2o4Yt6F5yKJUJ/view?usp=sharing.
The first sheet is a multiple drop down using this VBA code:
Option Explicit
Private Sub Worksheet_Change(ByVal Destination As Range)
Dim DelimiterType As String
Dim rngDropdown As Range
Dim oldValue As String
Dim newValue As String
DelimiterType = vbCrLf
If Destination.Count > 1 Then Exit Sub
On Error Resume Next
Set rngDropdown = Cells.SpecialCells(xlCellTypeAllValidation)
On Error GoTo exitError
If rngDropdown Is Nothing Then GoTo exitError
If Intersect(Destination, rngDropdown) Is Nothing Then
'do nothing
Else
Application.EnableEvents = False
newValue = Destination.Value
Application.Undo
oldValue = Destination.Value
Destination.Value = newValue
If oldValue = "" Then
'do nothing
Else
If newValue = "" Then
'do nothing
Else
Destination.Value = oldValue & DelimiterType & newValue
' add new value with delimiter
End If
End If
End If
exitError:
Application.EnableEvents = True
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
End Sub
The second sheet is trying to use the sheet 1 table as a base for pivot table analysis. I explain there that I would like the selections to be listed as separate. I might be way in over my head with this, but figure it was worth a shot posting here in case there is a relatively easy fix.
I am certainly open to hearing about other ways to possibly analyze the data that isn't a pivot table - but all I really want to know (based on the mock) is: how many people selected "orange" in the multi-drop down? In reality, I have a much larger dataset where multi-drop down is very useful.
Thanks for any help!
The entries in your spreadsheet, created by that VBA routine. show as
Multiple response to a drop down can't be mixed in one cell; there can, however, be multiple rows, with the person's name appearing multiple times, once for each selection, (in any sequence). With the data arranged that way, Pivot Table correctly summarizes.
So I guess the question to you--assuming you want to use VBA to populate that sheet of selections--can the VBA routine be modified to create it differently?