Consulting

Results 1 to 5 of 5

Thread: Solved: change font color after updated

  1. #1

    Solved: change font color after updated

    Hi All,

    this is my first question in vbaexpress, i'm not an IT, so i wish you can explain it more detail.
    okay, i have data, i.e in column E i have a numbers.
    now, if i change/update that cells in column e, i want to automatically change color of that font or maybe color of cells.

    can excel do that...

    many thanks for you kind.

    regards,

    reza

  2. #2
    VBAX Mentor
    Joined
    Jun 2004
    Posts
    363
    Location
    The following will change the font color to red in column E after the value has changed.
    Right click on the sheet's tab and choose View Code.
    Paste the following:
    [vba]Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Column = 5 Then
    Target.Font.Color = vbRed
    End If
    End Sub[/vba]

  3. #3
    mbarron...

    work greats...many thanks
    how about if i want to add column, i my first post i said in column E, now i want to column F, G, K also like that.

    many thanks again

    reza

  4. #4
    VBAX Mentor
    Joined
    Jun 2004
    Posts
    363
    Location
    The following example would change the font color for cells in columns E, F, I, J, K, or N

    For continuous columns use first:last designations such as A:D for columns A through D. For single columns use column:column such as A:A for just the A column.

    [vba]Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("E:F,I:J,N:N")) Is Nothing Then
    Target.Font.Color = vbRed
    End If
    End Sub
    [/vba]

  5. #5
    Quote Originally Posted by mbarron
    The following example would change the font color for cells in columns E, F, I, J, K, or N

    For continuous columns use first:last designations such as A for columns A through D. For single columns use column:column such as A:A for just the A column.

    [vba]Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("E:F,I:J,N:N")) Is Nothing Then
    Target.Font.Color = vbRed
    End If
    End Sub
    [/vba]
    work greats...thanks barron...

Posting Permissions

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