Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2007

Tip: Looking for answers? Try searching our database.

Cell Fill Colors

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dbizek - 31 Jan 2007 14:59 GMT
Is there a way to program cell fill colors on and off.
Either using the "IF" statement or some other way?
Bob Phillips - 31 Jan 2007 15:05 GMT
Conditional formatting, see http://xldynamic.com/source/xld.CF.html

Signature

---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

> Is there a way to program cell fill colors on and off.
> Either using the "IF" statement or some other way?
Susan - 31 Jan 2007 15:06 GMT
if <your condition> then
range().Interior.ColorIndex = ' enter a # 1 thru 56
end if

susan

> Is there a way to program cell fill colors on and off.
> Either using the "IF" statement or some other way?
Juan Pablo González - 31 Jan 2007 15:08 GMT
Take a look at Conditional Formatting in the Format menu.  You can use a
cell value or a formula that evaluates to TRUE/FALSE to assign a format to
cells, including the fill color.

Signature

Regards,

Juan Pablo González

> Is there a way to program cell fill colors on and off.
> Either using the "IF" statement or some other way?
Mike - 31 Jan 2007 15:13 GMT
Yes, use the formula option in conditional formatting. Post the condition you
want to evaluate if you need more assistance

> Is there a way to program cell fill colors on and off.
> Either using the "IF" statement or some other way?
Michael Kimmerly - 31 Jan 2007 16:19 GMT
Pardon me for the semi-hijack. Can you automatically format the text only
portion of a numeric-text string in a cell. For instance, can you bold only
the text in a string such as "$20,000 High Sales" making the text bold or a
different color while the numbers stay in standard format?

Thanks

On 1/31/07 9:13 AM, in article
00A98272-95A0-4C31-BA92-D46FF45BE21F@microsoft.com, "Mike"

> Yes, use the formula option in conditional formatting. Post the condition you
> want to evaluate if you need more assistance
>
>> Is there a way to program cell fill colors on and off.
>> Either using the "IF" statement or some other way?
Bob Phillips - 31 Jan 2007 16:28 GMT
Not without VBA.

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10"     '<== change to suit
Dim i As Long

   On Error GoTo ws_exit
   Application.EnableEvents = False

   If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
       With Target
           For i = 1 To Len(.Value)
               If IsNumeric(Mid(.Value, i, 1)) Then
                   .Characters(i, 1).Font.Bold = True
               End If
           Next i
       End With
   End If

ws_exit:
   Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click

Signature

---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

> Pardon me for the semi-hijack. Can you automatically format the text only
> portion of a numeric-text string in a cell. For instance, can you bold
[quoted text clipped - 14 lines]
>>> Is there a way to program cell fill colors on and off.
>>> Either using the "IF" statement or some other way?
Michael Kimmerly - 31 Jan 2007 16:50 GMT
Thanks Bob. Will study the code, been years since I used VB or VBA, but I
assumed it could be done that way. A co-worker thought standard or
conditional formatting could do it but I could not figure a way. Much
Appreciated.

On 1/31/07 10:28 AM, in article #eHOYTVRHHA.4000@TK2MSFTNGP04.phx.gbl, "Bob
Phillips" <bob.NGs@xxxx.com> wrote:

> Not without VBA.
>
[quoted text clipped - 24 lines]
> 'placed in the appropriate worksheet code module, not a standard
> 'code module. To do this, right-click
Gord Dibben - 31 Jan 2007 17:29 GMT
Typo patrol!

Change to If Not IsNumeric for bold text and standard numbers.

Gord Dibben  MS Excel MVP

>Not without VBA.
>
[quoted text clipped - 24 lines]
>'placed in the appropriate worksheet code module, not a standard
>'code module. To do this, right-click
Bob Phillips - 31 Jan 2007 19:03 GMT
Not a typo Gord, I really thought he wanted the numbers bolded, its the eyes
failing :-(

Signature

---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

> Typo patrol!
>
[quoted text clipped - 30 lines]
>>'placed in the appropriate worksheet code module, not a standard
>>'code module. To do this, right-click
Gord Dibben - 31 Jan 2007 22:24 GMT
I stand corrected on the "typo" pickup.

Now......if we could just get the eyesight corrected as easily<g>

>Not a typo Gord, I really thought he wanted the numbers bolded, its the eyes
>failing :-(
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.