activecell color

  • Thread starter Thread starter alldreams
  • Start date Start date
A

alldreams

what is the best way to change the color of the
activecell?

Thanks for your help.
 
Activecell.Interior.ColorIndex = 3

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
I get this error:

Object doesn't support this object or method

Sub color()
ActiveCell.ColorIndex = 3
End Sub

I want the activecell, at all times, to be gray.

Any suggestions?
 
this work. However, the color change remains after I
changed to a different cell. I want to dynamically
change the color of the activecell only

thanks!
 
You need VBA for this

Dim prev As Range

Private Sub Worksheet_Activate()
Set prev = ActiveCell
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

ActiveCell.Interior.ColorIndex = 15
prev.Interior.ColorIndex = xlColorIndexNone
Set prev = ActiveCell
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
It might be worthy to note that an often undesirable side effect of this is
that you will lose the ability to undo edits as many macros cause the undo
history to zero out.
 

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

Back
Top