Una famiglia di software per fogli di calcolo Microsoft con strumenti per l'analisi, la creazione di grafici e la comunicazione dei dati.
Saluto Norman che mi ha preceduto, un altro modo, visto che l'ho scritta:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim strDelimiter As String, rngValidation As Range, strOld As String, strNew As String
strDelimiter = ", "
If Target.Count > 1 Then Exit Sub
On Error Resume Next
Set rngValidation = Cells.SpecialCells(xlCellTypeAllValidation)
On Error GoTo Esci
If rngValidation Is Nothing Then GoTo Esci
If Not Intersect(Target, rngValidation) Is Nothing Then
Application.EnableEvents = False
strNew = Target.Value
Application.Undo
strOld = Target.Value
Target.Value = strNew
If strOld <> "" Then
If strNew <> "" Then
Target.Value = strOld & strDelimiter & strNew
End If
End If
End If
Esci:
Application.EnableEvents = True
End Sub
Da mettere nel codice del foglio e non nel modulo generale,
ciao.