SA_Carpenter
New Member
- Joined
- Jul 1, 2022
- Messages
- 1
- Office Version
- 365
- 2021
- Platform
- Windows
Hello,
Hopefully someone can help
I am trying to highlight the values in one "Amdt x" whenever it differs from the value in "Current Amdt". Originally I called out the column letter, but as the table changes and gets updated I want to use the column names to avoid having to rework the macro every time.
My table looks something like
and the code I was using before is
Essentially I wanna replace $D2 with Amdt x and $E2 with Current Amdt. Hopefully I explained this well enough and any help would be appreciated
Hopefully someone can help
I am trying to highlight the values in one "Amdt x" whenever it differs from the value in "Current Amdt". Originally I called out the column letter, but as the table changes and gets updated I want to use the column names to avoid having to rework the macro every time.
My table looks something like
and the code I was using before is
VBA Code:
ActiveSheet.ListObjects("Table1").ListColumns("Amdt x").Range.Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$D2<>$E2"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 6053086
.TintAndShade = 0
Essentially I wanna replace $D2 with Amdt x and $E2 with Current Amdt. Hopefully I explained this well enough and any help would be appreciated