4
Contributors
3
Replies
4
Views
11 Years
Discussion Span
Last Post by Comatose
1

Hi, im having trobles with excel
how I can chance the color of the text in a specific cell from vb??

any help??

I find a good way to learn VB code is to record a macro in excel or word etc then use ALT + F11 to open the Visual Basic editor and look at the code. F8 will step you through the code so you can see what each line does. Try copy and paste the code below and see if this solves your problem.

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 14/07/06 by x
'
'
Range("A1").Select
Selection.Font.ColorIndex = 41
Range("B1").Select
ActiveCell.FormulaR1C1 = "fdhgghh"
Range("B1").Select
Selection.Font.ColorIndex = 41
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
End Sub

Votes + Comments
Nice Find
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.