Hi.
I have been trying to modify and insert this code into an existing macro code.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Oldvalue As String
Dim Newvalue As String
On Error GoTo Exitsub
If Target.Address = "$C$5" 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:
My challenge. I need the function of multiple selections from a drop-down to load to a variable that will update to a data table.
I have tinkered with inserting it into my existing code, but it is not working.
Ex. sheet 1, cell c66 has the dropdown list, they need to choose 4-5 items from that dropdown list, the selected items will load to string named offices, then offices will transfer to a specific column worksheet 2
I have been trying to modify and insert this code into an existing macro code.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Oldvalue As String
Dim Newvalue As String
On Error GoTo Exitsub
If Target.Address = "$C$5" 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:
My challenge. I need the function of multiple selections from a drop-down to load to a variable that will update to a data table.
I have tinkered with inserting it into my existing code, but it is not working.
Ex. sheet 1, cell c66 has the dropdown list, they need to choose 4-5 items from that dropdown list, the selected items will load to string named offices, then offices will transfer to a specific column worksheet 2