Cell color change without macro

b0unce

Board Regular
Joined
Apr 22, 2009
Messages
75
Hello,

is there a way to change cell color on certain cell selection without performing a macro?
For example, when I select any cell on column D, I need cell range A1:B3 to highlight in any color. Or to be distinguished in any other way. After I deselect column D, I need the highlight from range A1:B3 to disappear.
I know how to do that with macro, but that is not a very good solution, as it does not allow using UNDO function later. And as this macro run on Selection_change, I will never be able to use UNDO; even if I did not select column D. This make working with the file more complicated.

Is anyone aware of a walk around how to make certain cells to be highlighted without triggering a macro? Thank you in adcance!
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
If you want to trigger cells to be highlighted on a selection then VBA is the way to go.
If you want to highlight cells based on values then Conditional Formatting is the approach to take.
 
Upvote 0
How about...

Conditional Formatting
  • Highlight applicable range >> A1:B3
  • Home Tab >> Styles >> Conditional Formatting
  • New Rule >> Use a formula to determine which cells to format
  • Edit the Rule Description: Format values where this formula is true: =COUNTA($D:$D)>0
  • Format… [Number, Font, Border, Fill]
  • OK >> OK
 
Upvote 0
Hello,

thank you both for replying!
Special-K99, I want to highlight cells based on selection; so I guess I should use VBA..

jeffreybrown, your solution highlights A1:B3 (or any other range, which has the formatting applied) regardless the selection. It just checks whether column D has any data in it. But I need formatting to be applied if I SELECT any cell from column D.

Thanks for trying to help!
 
Upvote 0

Forum statistics

Threads
1,214,838
Messages
6,121,885
Members
449,057
Latest member
Moo4247

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