PDA

View Full Version : Solved: change font color after updated



reza_doang
05-24-2010, 08:28 PM
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. : pray2:

regards,

reza

mbarron
05-24-2010, 08:52 PM
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:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 5 Then
Target.Font.Color = vbRed
End If
End Sub

reza_doang
05-24-2010, 09:06 PM
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

mbarron
05-25-2010, 03:43 AM
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.

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

reza_doang
05-25-2010, 07:37 PM
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.

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

work greats...thanks barron...:thumb :bow: