#1
|
|||
|
|||
Excel VBA font colour
Can anyone help please with an excel VBA question?
I am on cell A1 and wish to start macro: If font colour is red, change to black (automatic) if font colour is not red, change to red i.e toggle between red and black. Any advice appreciated. Gus |
#2
|
|||
|
|||
Code:
Sub FontRedOrBlack() Dim c As Range Set c = [a1] With c Select Case .Font.Color Case vbRed .Font.Color = vbBlack Case Else .Font.Color = vbRed End Select End With End Sub |
#3
|
|||
|
|||
Excel vba font colour
Kenneth,
Thank you very much for your help. That one was way beyond my expertise. Very grateful. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Changing Font Colour & Style | Tibsen21 | Word | 4 | 11-05-2018 03:10 PM |
Font colour & highlighting does not work | DreamGirl | Excel | 2 | 02-13-2012 06:00 AM |
Font colour and format changing? | Lamya | Word | 5 | 05-16-2011 02:35 AM |
Font Size & Colour | yparuk | PowerPoint | 0 | 10-07-2010 12:37 AM |
font colour problems | darro | Outlook | 0 | 11-25-2009 03:50 PM |