Forum Discussion
chowell97
Aug 15, 2023Copper Contributor
VBA
Hello, I have a simple excel table with three columns, Current, Replaced, and New. The Current column contains a specific date. The Replaced column contains either Yes or No. If the Replaced c...
- Aug 15, 2023
chowell97 To get a cell in an adjacent column of the table, use syntax like this:
Change this line:
Set N = tbl.ListColumns("New").DataBodyRange
to:
Set N = Intersect(tbl.ListColumns("New").DataBodyRange, Target.EntireRow)
You can now use n.Value to get the value of the New column on the same row as the changed cell (Target).
Adjust the other lines accordingly.
JKPieterse
Aug 15, 2023Silver Contributor
chowell97 To get a cell in an adjacent column of the table, use syntax like this:
Change this line:
Set N = tbl.ListColumns("New").DataBodyRange
to:
Set N = Intersect(tbl.ListColumns("New").DataBodyRange, Target.EntireRow)
You can now use n.Value to get the value of the New column on the same row as the changed cell (Target).
Adjust the other lines accordingly.
- chowell97Aug 20, 2023Copper ContributorThank you Jan, this so far has corrected my issues.