Selected Cell Colour Change

LEVICC01

New Member
Joined
Aug 27, 2010
Messages
42
Hi guys,

I'm sure this is really easy, but i am really struggling to get it to work.

I'd like a cell that i select to change its text colour to a different colour specified by me.

I'm currently using a formula for conditional format:

=AND(ROW()=CELL("row"),COLUMN()=CELL("col"))

And a screenupdating = true statement in the code.

It is very slow and does not react well. is there a better way?
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
suppose you are interested in column A in which you enter or change the data
try this

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 1 Then Exit Sub 'this means you are interests only in column A
Target.Font.ColorIndex = 3  '3 is  red,6 yellow,4 green
End Sub

as you enter or change in any cell in column A the font will change to red.
 
Upvote 0
Hi,

This is great, but it highlights the entire column. And i can use this for something else, thank you very much.

What i have is an Exec Dashboard, hyperlinked to a drill down page that gives further information.

Because there are a number of pieces of information, i'd like it to highlight (only whilst selected), the title, so they know which part to look at.

Any ideas?
I couldnt get Activecell to work.
 
Upvote 0
in the event code can you restrict the cells which can be target. suppose you want the color only on A1 when it is entered or changed and no other cell which is altered

then replce

Code:
If Target.Column <> 1 Then Exit Sub

by

Code:
if target.address<>"$A$!" then exit sub

I am not clear what want. try this.l

if there are more than one but a few cells like that you can use "and"
 
Upvote 0
right click the sheet tab and in the window that comes up (delete the old event code "Private Sub Worksheet_Change(ByVal Target As Range)" completely.

now copy this code there

Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Target.Font.ColorIndex = 3
End Sub

now if you double click any cell that cell font will become red.
 
Upvote 0
Many thanks for this, this is very good, but not quite what im looking for.

I dont want the cell colour to stay that way, if i click off it, i want it to change back and change the one i select next.

To put it into context a little bit, i have a multi-level dashboard.

The top level is the Executive Summary, 4x3 charts with a very high level view

What i'd like is for the user to click any chart, and it will hyperlink to the relevant information on the next sheet, where more detailed information is held.

When the hyperlink selects the relevant cell, i want the fotn colour to change. But then when they click anywhere else, i'd like the cell to revert back, and the next cell to change.

Does that make sense?
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

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