Change cell colour to red

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi Everyone
I've got a grid , 81 cells with numbers in random cells.
I would like a macro to format the empty cells only, in red.
As you can see, I don't know much about macro except the recorder.

Just a start::
Sub Change2Red()
'
' Change2Red Macro
' Macro recorded 25/11/2008 by
' Range("B2:J10").Select
if cell is blank ?????
Selection.Font.ColorIndex = 3
End Sub
Thanking you in advance,
Regards
John

There is no failure except in no longer trying.
by: Elbert Hubbard
 
John,

It#s easier to use conditional formatting. Select B2 the drag top select all
your range of B1 - j10 then

Format|Conditional format
Formula is
=B2=""

Pick a colour
OK

Mike
 
Hi Mike
Thanks for your reply.
I can't use CF because when i will enter numbers, they will return to black
and I'm trying to separate visualy the new entries from the old entries.
Hope this is clear.
Regards
John
 
John

Right click your sheet tab, view code and paste this in and run it

Sub versive()
Set MyRange = Range("B2:J10")
For Each c In MyRange
If IsEmpty(c) Then
c.Interior.ColorIndex = 3
End If
Next
End Sub

Mike
 
HI Xlmate
Thank you for your reply but i'm getting a "Run time error 1004"
Method ' Range ' of object global failed.
Can you help me??
Regards
John
 
Your the Man, thank you very much.
It's not the first time that you've help me and I'm very grateful.
Thanks again Mike
Have a nice day
John
 
Your welcome

John said:
Your the Man, thank you very much.
It's not the first time that you've help me and I'm very grateful.
Thanks again Mike
Have a nice day
John
 

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