Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell Fill Colors
Is there a way to program cell fill colors on and off.
Either using the "IF" statement or some other way? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell Fill Colors
Conditional formatting, see http://xldynamic.com/source/xld.CF.html
-- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "dbizek" wrote in message ... Is there a way to program cell fill colors on and off. Either using the "IF" statement or some other way? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell Fill Colors
if <your condition then
range().Interior.ColorIndex = ' enter a # 1 thru 56 end if susan On Jan 31, 9:59 am, dbizek wrote: Is there a way to program cell fill colors on and off. Either using the "IF" statement or some other way? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell Fill Colors
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. -- Regards, Juan Pablo González "dbizek" wrote in message ... Is there a way to program cell fill colors on and off. Either using the "IF" statement or some other way? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell Fill Colors
Yes, use the formula option in conditional formatting. Post the condition you
want to evaluate if you need more assistance "dbizek" wrote: Is there a way to program cell fill colors on and off. Either using the "IF" statement or some other way? |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell Fill Colors
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 , "Mike" wrote: Yes, use the formula option in conditional formatting. Post the condition you want to evaluate if you need more assistance "dbizek" wrote: Is there a way to program cell fill colors on and off. Either using the "IF" statement or some other way? |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell Fill Colors
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 -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Michael Kimmerly" wrote in message ... 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 , "Mike" wrote: Yes, use the formula option in conditional formatting. Post the condition you want to evaluate if you need more assistance "dbizek" wrote: Is there a way to program cell fill colors on and off. Either using the "IF" statement or some other way? |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell Fill Colors
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 , "Bob Phillips" wrote: 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 |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell Fill Colors
Typo patrol!
Change to If Not IsNumeric for bold text and standard numbers. Gord Dibben MS Excel MVP On Wed, 31 Jan 2007 16:28:18 -0000, "Bob Phillips" wrote: 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 |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell Fill Colors
Not a typo Gord, I really thought he wanted the numbers bolded, its the eyes
failing :-( -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Gord Dibben" <gorddibbATshawDOTca wrote in message ... Typo patrol! Change to If Not IsNumeric for bold text and standard numbers. Gord Dibben MS Excel MVP On Wed, 31 Jan 2007 16:28:18 -0000, "Bob Phillips" wrote: 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 |
#11
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell Fill Colors
I stand corrected on the "typo" pickup.
Now......if we could just get the eyesight corrected as easily<g On Wed, 31 Jan 2007 19:03:07 -0000, "Bob Phillips" wrote: Not a typo Gord, I really thought he wanted the numbers bolded, its the eyes failing :-( |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Used drawing colors in shapes....lost default colors for "Fill Col | Excel Discussion (Misc queries) | |||
Using if function with cell fill colors | Excel Programming | |||
Cell fill colors don't appear to work... | Excel Discussion (Misc queries) | |||
Can't format font colors or cell fill-in colors | Excel Discussion (Misc queries) | |||
How do I fill row colors based on cell value? | Excel Discussion (Misc queries) |