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

any help??

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

commented: Nice Find +3

That's a really good find.....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.