Leicester City Fox
Board Regular
- Joined
- Oct 7, 2016
- Messages
- 91
- Office Version
- 2019
- Platform
- Windows
Hi there
Need some help I put the vba in for a cell to select multiple drop down options and it works .
But when I change it so you can do this to the whole column it don't work and it still only work in the original cell.
Its Column T which is Column number 20 but start in cell T8:
Sub DropSelMult()
Dim Oldvalue As String
Dim Newvalue As String
On Error GoTo Exitsub
If Target.Column = 20 Then
If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then
GoTo Exitsub
Else: If Target.Value = "" Then GoTo Exitsub Else
Application.EnableEvents = False
Newvalue = Target.Value
Application.Undo
Oldvalue = Target.Value
If Oldvalue = "" Then
Target.Value = Newvalue
Else
Target.Value = Oldvalue & ", " & Newvalue
End If
End If
End If
Application.EnableEvents = True
Exitsub:
Application.EnableEvents = True
End Sub
Any help in order to get this t work
Many Thanks
Leicester Fox
Need some help I put the vba in for a cell to select multiple drop down options and it works .
But when I change it so you can do this to the whole column it don't work and it still only work in the original cell.
Its Column T which is Column number 20 but start in cell T8:
Sub DropSelMult()
Dim Oldvalue As String
Dim Newvalue As String
On Error GoTo Exitsub
If Target.Column = 20 Then
If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then
GoTo Exitsub
Else: If Target.Value = "" Then GoTo Exitsub Else
Application.EnableEvents = False
Newvalue = Target.Value
Application.Undo
Oldvalue = Target.Value
If Oldvalue = "" Then
Target.Value = Newvalue
Else
Target.Value = Oldvalue & ", " & Newvalue
End If
End If
End If
Application.EnableEvents = True
Exitsub:
Application.EnableEvents = True
End Sub
Any help in order to get this t work
Many Thanks
Leicester Fox