Try this in a copy of your book ..
Right-click on the Excel icon to the left of File on the main menu > Choose
View Code
Copy n paste the workbook open code below (1) into the whitespace on the
right
'------ (1) -----
Option Explicit
Private Sub Workbook_Open()
ThisWorkbook.Sheets("SameCell") _
.Protect DrawingObjects:=True, _
contents:=True, Scenarios:=True, _
UserInterfaceOnly:=True
End Sub
'----------------
Press Alt+Q to get back to Excel
Right-click on the sheet (where you have the DV in col G. Col G = col "7")
Copy n paste the sheet code below (2) into the whitespace on the right
'-------(2)------
Option Explicit
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 = 7 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
'----------
Press Alt+Q to get back to Excel
Save the file, close it and re-open
Test out the DV you have in col G on this sheet. It should function as
desired.
I'm not savvy enough to amend Debra's code to make it work for col H as well
on the same sheet. Hang around awhile for insights from others versed in vba
to jump in.
---