Color de letra y Color para fondo de Celda
' si quieres me envias tu correo y te mando un archivo de excel con el ejemplo
'
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Worksheets("Hoja2").PageSetup.LeftHeader = "Realizado por: Armando Fuenmayor, patusnalgason@hotmail.com"
With Worksheets("Hoja2").Cells(1, 1)
.Value = "Si la cantidad que introduzcas es menor que cero entonces los Color fuente rojo y el interior de la celda es marron "
.Font.Size = 15 ' tamaño de letra
.Font.Bold = True ' Fuente en negrita
.Font.ColorIndex = 1 ' Color fuente = blanco
End With
Worksheets("Hoja2").Cells(7, 1).Value = " Nº "
Worksheets("Hoja2").Cells(7, 2).Value = " Cantidad "
cuantos = 0
x = 1
con = 8
cuenta = 0
While Worksheets("Hoja2").Cells(con, 2).Value <> ""
cuenta = cuenta + 1
Worksheets("Hoja2").Cells(con, 1).Value = x
con = con + 1
x = x + 1
cuantos = x
Wend
con = 7
For i = 1 To cuantos - 1
If (Worksheets("Hoja2").Cells(i + con, 2).Value < 0) Then
With Worksheets("Hoja2").Cells(i + con, 2)
.Font.Bold = True
.Font.ColorIndex = 3
.Interior.ColorIndex = 9
End With
Else
With Worksheets("Hoja2").Cells(i + con, 2)
.Font.Bold = True
.Font.ColorIndex = 7
.Interior.ColorIndex = 4
End With
End If
Next i
End Sub