Conditional to change cell color by Selecting Cells

M

maperalia

It is possible to change the font color of the select cell only.
For example, If I select the cell A1 I want to see the font in blue, bold,
however, after I select the cell A2 I want the cell A1 to return to its
previous setup and get the blue, bold at cell A2.
Therefore, the conditional will work only for selected cell if not select
return to original setup.

Thanks in advance.
Maperalia
 
M

Mike H

Try this:-

Right click the sheet tab and paste this in.

Public LastCell As Range

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not LastCell Is Nothing Then
LastCell.Interior.ColorIndex = xlNone
End If
Target.Interior.ColorIndex = 6
Set LastCell = Target
End Sub

Mike
 
M

maperalia

Mike;
Thanks for the code works wonderful!!. However, I forgot to mention that the
sheet where I want to put this conditional does not exist in the original
"Template File".

After I run a specific macro in the "Template File". The sheet where I want
to put this conditional is been created and named it as a "LIST". Therefore,
my question is; what statement can I use to insert the module on this sheet
when I run the macro?

Thanks.
Maperalia.
 
M

maperalia

JB;
Thanks for the formula. However, when I put it in the condition an then
click OK I got the message that the formula has error.

Maperalia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top