Forum Discussion

chowell97's avatar
chowell97
Copper Contributor
Aug 15, 2023
Solved

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...
  • JKPieterse's avatar
    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.

Resources