VBA Conditional Formatting with vlookup

KSC17ME

New Member
Joined
Mar 1, 2019
Messages
1
Can someone help to translate the following NON-VBA conditional formatting into VBA conditional formatting?

The rules that I have set up work as intended, but due to the need to merge and unmerge cells on the sheet, NON-VBA conditional formatting updates the "applies to" range and creates additional conditional formatting rules by itself. I am hoping that by removing the NON-VBA conditional formatting and having it done through VBA will eliminate the rules being changed by excel.

Conditional formatting applies to =$A$1:$BJ$105
Use a formula to determine which cells to format =IF(VLOOKUP(A1,'ITEM LIST'!$D:$G,4,0)='Data Validations'!$D$13,1,0)
Set background color to any value you choose for now (I can change the color value later)
Sheet name Hot Line Map
There are 20 different conditional formatting rules that are identical to the above, but have a different value for the red highlight.

I also need to have the above 20 rules apply to
Sheet name Walkin Map
These 20 rules are identical to the above formula except for the value highlighted in purple


Again, I have all of this working in NON-VBA, I am just looking to have it work through VBA.

Any questions please let me know.
Thanks
Kevin
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,214,985
Messages
6,122,607
Members
449,090
Latest member
vivek chauhan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top