Results 1 to 9 of 9
  1. #1
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Change Font color after amend contents (Office XP)

    You can use Format | Conditional Formatting...
    If you would like further help, please provide sufficient information.

  2. #2
    Star Lounger
    Join Date
    Jun 2005
    Location
    Singapore
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Change color (Office XP

    Hi all,

    Can the color of the fonts for the row be change without manually selecting the said row upon changing the content of a cell in the row.

    Is it possible to change the color of the cells for the rows with Sub totals and Grand Total after summing them.Pls advise how to acheive it.

    Thanks Always, kun

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Change color (Office XP

    For subtotals etc., try Format | AutoFormat...

  4. #4
    Star Lounger
    Join Date
    Jun 2005
    Location
    Singapore
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change Font color after amend contents (Offic

    Hans,

    Thank you for your prompt response, I try using the conditional formatting but nothing change. What I am tring to achieve is whenever I change the content or add new data which is text any of the cells in Column B, the fonts for the whole row change to red .

    Thanks, kun

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Change Font color after amend contents (Offic

    Say that you change cell B3, and this causes all cell contents in row 3 to be colored red.
    Next, you change cell B7. Should the contents of row 3 be changed back to black text, or should they stay red?

  6. #6
    Star Lounger
    Join Date
    Jun 2005
    Location
    Singapore
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change Font color after amend contents (Offic

    they stay in red.

    thanks, kun

  7. #7
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change Font color after amend contents (Offic

    Put this code in the worksheet change event routine for the worksheet.

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim oCell As Range
    If Intersect(Target, Range("B:B")) Is Nothing Then Exit Sub
    For Each oCell In Intersect(Target, Range("B:B"))
    oCell.EntireRow.Font.ColorIndex = 3
    Next oCell
    End Sub

    Does that do what you want?
    Legare Coleman

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Change Font color after amend contents (Offic

    Right-click the sheet tab of the worksheet.
    Select "View Code" from the popup menu.
    Enter or paste the following code into the worksheet module:

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("B:B")) Is Nothing Then
    Application.EnableEvents = False
    Intersect(Target, Range("B:B")).EntireRow.Font.ColorIndex = 3
    Application.EnableEvents = True
    End If
    End Sub

    This event procedure will run each time a cell is changed by the user. It checks if the cell is in column B and if so, changes the colorindex of the font of the entire row to 3 (= red).

  9. #9
    Star Lounger
    Join Date
    Jun 2005
    Location
    Singapore
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change Font color after amend contents (Offic

    Legare AND Hans,

    It works perfectly! Thank you.

    cheers, kun

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •