PC Review


Reply
Thread Tools Rate Thread

Change cell colour to red

 
 
John
Guest
Posts: n/a
 
      25th Nov 2008
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
 
Reply With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      25th Nov 2008
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


"John" wrote:

> 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
>

 
Reply With Quote
 
John
Guest
Posts: n/a
 
      25th Nov 2008
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
"Mike H" <(E-Mail Removed)> wrote in message
news:6471AA7B-2A78-4E6E-BF07-(E-Mail Removed)...
> 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
>
>
> "John" wrote:
>
>> 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
>>


 
Reply With Quote
 
Mike H
Guest
Posts: n/a
 
      25th Nov 2008
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

"John" wrote:

> 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
> "Mike H" <(E-Mail Removed)> wrote in message
> news:6471AA7B-2A78-4E6E-BF07-(E-Mail Removed)...
> > 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
> >
> >
> > "John" wrote:
> >
> >> 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
> >>

>
>

 
Reply With Quote
 
John
Guest
Posts: n/a
 
      25th Nov 2008
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
"xlmate" <(E-Mail Removed)> wrote in message
news:EC491523-2898-48FE-9874-(E-Mail Removed)...
>
> Since the cells are blanks, this line doesn't do anything
> Selection.Font.ColorIndex = 3
>
> Try this macro
>
> Sub Change2Red()
> With ActiveSheet
> Range("A1:E4").SpecialCells(xlCellTypeBlanks).Interior.ColorIndex
> = 3
>
> End With
> End Sub
> Does this do what you want?
> Pls click Yes if this help.
>
> cheers
>
>
> "John" wrote:
>
>> 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
>>


 
Reply With Quote
 
John
Guest
Posts: n/a
 
      25th Nov 2008
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
"Mike H" <(E-Mail Removed)> wrote in message
news:E56E3DC0-1533-4569-A0BC-(E-Mail Removed)...
> 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
>
> "John" wrote:
>
>> 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
>> "Mike H" <(E-Mail Removed)> wrote in message
>> news:6471AA7B-2A78-4E6E-BF07-(E-Mail Removed)...
>> > 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
>> >
>> >
>> > "John" wrote:
>> >
>> >> 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
>> >>

>>
>>


 
Reply With Quote
 
Mike H
Guest
Posts: n/a
 
      25th Nov 2008
Your welcome

"John" wrote:

> 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
> "Mike H" <(E-Mail Removed)> wrote in message
> news:E56E3DC0-1533-4569-A0BC-(E-Mail Removed)...
> > 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
> >
> > "John" wrote:
> >
> >> 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
> >> "Mike H" <(E-Mail Removed)> wrote in message
> >> news:6471AA7B-2A78-4E6E-BF07-(E-Mail Removed)...
> >> > 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
> >> >
> >> >
> >> > "John" wrote:
> >> >
> >> >> 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
> >> >>
> >>
> >>

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change cell colour on formula result change, no conditional format roster_jon Microsoft Excel Programming 0 2nd Dec 2008 12:11 PM
if cell colour is then change cell colour in range =?Utf-8?B?dGlnZXI=?= Microsoft Excel Programming 2 30th May 2007 05:32 AM
change current cell colour based on the value of adjacent cell on other worksheet Rits Microsoft Excel Programming 2 23rd Nov 2006 11:57 AM
change a cell background colour to my own RGB colour requirements =?Utf-8?B?U3RlcGhlbiBEb3VnaHR5?= Microsoft Excel Misc 4 16th Jun 2006 01:08 PM
How can i change cell colour depending on month of date in cell? andy75 Microsoft Excel Misc 2 6th Jan 2006 07:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:16 AM.