I`ve got a bit of issue setting up an excel sheet.
Im setting up a training programme for work and have run into a problem when using "data validation".
For instance, I have set up column A to run a drop down list using data validation. What is chosen then leads to a further data validation list in column B. This all works fine, but what if I want to select multiple options from the list?
I have combated that by using the following code in column B
Here is where I get the problem. What if want multiple selections in column A, that lead to the corrosponding sub menus. As is stands at the moment, if I apply the code to column A, Column B draws a blank.Code: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 = 4 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
Any help would be much appreciated.
Thanks