Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Change cell colour to red

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Change cell colour to red

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Change cell colour to red

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" wrote in message
...
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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Change cell colour to red

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" wrote in message
...
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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Change cell colour to red

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" wrote in message
...
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" wrote in message
...
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






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Change cell colour to red

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" wrote in message
...
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" wrote in message
...
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





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 144
Default Change cell colour to red


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).Inte rior.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

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Change cell colour to red

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" wrote in message
...

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).Inte rior.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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change colour in cell Haris Excel Worksheet Functions 1 October 28th 07 08:25 AM
if cell colour is then change cell colour in range tiger Excel Programming 2 May 30th 07 05:32 AM
Change colour of cell if there is no value Max Excel Worksheet Functions 0 August 19th 06 08:44 PM
change a cell background colour to my own RGB colour requirements Stephen Doughty Excel Discussion (Misc queries) 4 June 16th 06 01:08 PM
Change cell colour cityfc Excel Worksheet Functions 2 November 12th 05 10:58 AM


All times are GMT +1. The time now is 05:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"