TheRogue!
Board Regular
- Joined
- Mar 2, 2012
- Messages
- 84
- Office Version
- 2021
- Platform
- Windows
I'm terrible w/ VBA, so I appologize, in advance.
I have a table (Table1), with 3 columns (ColumnA, ColumnB & ColumnC).
I need to come up w/ some VBA code for a Cell Change Event.
If anyone types anything in ColumnA, I need the cell in ColumnC of the corresponding row to automatically populate with "banana"
If anyone types anything in ColumnB, I need the cell in ColumnC of the corresponding row to automatically populate with "strawberry"
ColumnC should indicate either "banana" or "strawberry" depending upon whether the data, in ColumnA or ColumnB, OF THE SAME ROW were changed last.
I've been trying (which obviously doesn't work):
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "Table1[ColumnA]" Then
[Table1[ColumnC]] = "banana"
ElseIf Target.Address = "Table1[ColumnB]" Then
[Table1[ColumnC]] = "strawberry"
End If
End Sub
I have a table (Table1), with 3 columns (ColumnA, ColumnB & ColumnC).
I need to come up w/ some VBA code for a Cell Change Event.
If anyone types anything in ColumnA, I need the cell in ColumnC of the corresponding row to automatically populate with "banana"
If anyone types anything in ColumnB, I need the cell in ColumnC of the corresponding row to automatically populate with "strawberry"
ColumnC should indicate either "banana" or "strawberry" depending upon whether the data, in ColumnA or ColumnB, OF THE SAME ROW were changed last.
I've been trying (which obviously doesn't work):
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "Table1[ColumnA]" Then
[Table1[ColumnC]] = "banana"
ElseIf Target.Address = "Table1[ColumnB]" Then
[Table1[ColumnC]] = "strawberry"
End If
End Sub