Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default if cell contains formula change background colour to pale yellow

I'd like to be able to do this:

if cell contains formula change background colour to pale yellow

how would I write that in vba, please


--
Regards,
David Lindstrom


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default if cell contains formula change background colour to pale yellow

David here is one way

Sub Color_Formula_Cell()
On Error GoTo e:
With Cells
..Interior.ColorIndex = 0
..SpecialCells(xlFormulas).Interior.ColorIndex = 36
End With
Exit Sub
e: MsgBox "There are no formulas or the sheet is protected"
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
"Max Bialystock" wrote in message
...
I'd like to be able to do this:

if cell contains formula change background colour to pale yellow

how would I write that in vba, please


--
Regards,
David Lindstrom




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default if cell contains formula change background colour to pale yellow

Paul,

That's terrific thank you. That's just what I wanted.

--
Regards,
David Lindstrom


"Paul B" wrote in message
...
David here is one way

Sub Color_Formula_Cell()
On Error GoTo e:
With Cells
.Interior.ColorIndex = 0
.SpecialCells(xlFormulas).Interior.ColorIndex = 36
End With
Exit Sub
e: MsgBox "There are no formulas or the sheet is protected"
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
"Max Bialystock" wrote in message
...
I'd like to be able to do this:

if cell contains formula change background colour to pale yellow

how would I write that in vba, please


--
Regards,
David Lindstrom






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 background colour hollies Excel Worksheet Functions 3 October 8th 09 11:54 PM
Change background colour of a row if a particular cell has a value wolfey Excel Discussion (Misc queries) 1 August 3rd 09 12:45 PM
how do i change cell background colour depending on its content? demble Excel Discussion (Misc queries) 2 May 2nd 07 05:50 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 background colour cityfc Excel Discussion (Misc queries) 1 November 11th 05 01:03 PM


All times are GMT +1. The time now is 01:19 PM.

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

About Us

"It's about Microsoft Excel"