Загрузка данных


Private Sub Worksheet_Change(ByVal Target As Range)
    Dim Oldvalue As String
    Dim Newvalue As String
    
    ' Настройка: укажите ячейку или диапазон с выпадающим списком (например, "A1" или "A1:A10")
    If Not Intersect(Target, Range("A1")) Is Nothing Then
        If Target.Cells.Count > 1 Then Exit Sub
        
        On Error Resume Next
        Newvalue = Target.Value
        Application.EnableEvents = False
        Application.Undo
        Oldvalue = Target.Value
        Target.Value = Newvalue
        Application.EnableEvents = True
        
        If Oldvalue <> "" Then
            If Newvalue <> "" Then
                ' Разделитель между значениями — запятая с пробелом (", ")
                Target.Value = Oldvalue & ", " & Newvalue
            End If
        End If
    End If
End Sub