VBA for conditional formatting

afrobea_r

Board Regular
Joined
Aug 16, 2015
Messages
76
Dear Excel Community,

I currently have a sheet with data resembling this:

[TABLE="width: 139"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Plan[/TD]
[TD] Days[/TD]
[/TR]
[TR]
[TD]Intended [/TD]
[TD] 13[/TD]
[/TR]
[TR]
[TD]Unintended[/TD]
[TD] 12[/TD]
[/TR]
[TR]
[TD]Intended [/TD]
[TD] 14[/TD]
[/TR]
[TR]
[TD]Intended[/TD]
[TD] 15[/TD]
[/TR]
[TR]
[TD]Intended[/TD]
[TD] 16[/TD]
[/TR]
[TR]
[TD]Unintended[/TD]
[TD] 8[/TD]
[/TR]
</tbody>[/TABLE]

As the conditional formatting function does not allow application of thick coloured borders, what kind of macro can I use to dynamically apply a thick red border to those cells in the days column only if their corresponding cell value in the plan column is 'unintended'? It must be dynamic as the row data may increase from time to time and certain values within existing rows will also change over time depending on info I have.

I have been stuck for some time. Any help is appreciated!! Thank you in advance!

Best Regards,
stuck
 
The last code I supplied should do that already, although it won't recognise text values.
If you modify it to recognise text values as well as numerical values, then it will pick up any cell with a formula that returns "".
Unfortunately I know of no way round this, other than removing the formulae

Thank you Sir its all good really appreciate your help on all this. What if I have certain cells that contain a date value: eg ([TABLE="width: 154"]
<tbody>[TR]
[TD]31-Dec-17 to 3-Feb-18). How can I then trigger a conditional to copy only cells with these values?


[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
The last code I supplied should do that already, although it won't recognise text values.
If you modify it to recognise text values as well as numerical values, then it will pick up any cell with a formula that returns "".
Unfortunately I know of no way round this, other than removing the formulae

Its all good Sir, thank you very much for your help on this. Really appreciate it. Regarding this issue, I have found a workaround, which is to change the "" into "NA" and then have another code to delete the cells with the NAs. That should solve the issue.

Have a great week ahead
 
Upvote 0
Glad you've sorted it & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,204
Members
453,022
Latest member
RobertV1609

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