Is there a way in VBA to change the font colour of adjcent cells. For example if cell A1 font is red i want cells a2 and a3 to have a red font aswell. I am relatively new to VBA, can anyone help?
This does what you are asking, it could probably be cleaned up for you specific needs. Anyway, here it is
Code:
ActiveSheet.UsedRange
For Each oCell In ActiveSheet.UsedRange.Columns(1).Cells
Range(Cells(oCell.Row, oCell.Offset(0, 1).Column), _
Cells(oCell.Row, oCell.Offset(0, 2).Column)).Font.ColorIndex _
= oCell.Font.ColorIndex
Next oCell
Here is what I have used in the past, this will change the font color of cells A1 and B1 to our companies' corporate colour, using the Red Green Blue function:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.