Aqui está o código para os 48 caracteres:
Sub M01_Colorir()
Range("B2").Select
With ActiveCell.Characters(Start:=1, Length:=3).Font
.Color = 3
End With
With ActiveCell.Characters(Start:=4, Length:=3).Font
.Color = -16776961
End With
With ActiveCell.Characters(Start:=7, Length:=3).Font
.Color = 3
End With
With ActiveCell.Characters(Start:=10, Length:=3).Font
.Color = -16776961
End With
With ActiveCell.Characters(Start:=13, Length:=3).Font
.Color = 3
End With
With ActiveCell.Characters(Start:=16, Length:=3).Font
.Color = -16776961
End With
With ActiveCell.Characters(Start:=19, Length:=3).Font
.Color = 3
End With
With ActiveCell.Characters(Start:=22, Length:=3).Font
.Color = -16776961
End With
With ActiveCell.Characters(Start:=25, Length:=3).Font
.Color = 3
End With
With ActiveCell.Characters(Start:=28, Length:=3).Font
.Color = -16776961
End With
With ActiveCell.Characters(Start:=31, Length:=3).Font
.Color = 3
End With
With ActiveCell.Characters(Start:=34, Length:=3).Font
.Color = -16776961
End With
With ActiveCell.Characters(Start:=37, Length:=3).Font
.Color = 3
End With
With ActiveCell.Characters(Start:=40, Length:=3).Font
.Color = -16776961
End With
With ActiveCell.Characters(Start:=43, Length:=3).Font
.Color = 3
End With
With ActiveCell.Characters(Start:=46, Length:=3).Font
.Color = -16776961
End With
End Sub
Sub M02_Negrito()
Range("B2").Select
With ActiveCell.Characters(Start:=1, Length:=3).Font
.FontStyle = "Normal"
End With
With ActiveCell.Characters(Start:=4, Length:=6).Font
.FontStyle = "Negrito"
End With
With ActiveCell.Characters(Start:=7, Length:=9).Font
.FontStyle = "Normal"
End With
With ActiveCell.Characters(Start:=10, Length:=12).Font
.FontStyle = "Negrito"
End With
With ActiveCell.Characters(Start:=13, Length:=15).Font
.FontStyle = "Normal"
End With
With ActiveCell.Characters(Start:=16, Length:=18).Font
.FontStyle = "Negrito"
End With
With ActiveCell.Characters(Start:=19, Length:=21).Font
.FontStyle = "Normal"
End With
With ActiveCell.Characters(Start:=22, Length:=24).Font
.FontStyle = "Negrito"
End With
With ActiveCell.Characters(Start:=25, Length:=27).Font
.FontStyle = "Normal"
End With
With ActiveCell.Characters(Start:=28, Length:=30).Font
.FontStyle = "Negrito"
End With
With ActiveCell.Characters(Start:=31, Length:=33).Font
.FontStyle = "Normal"
End With
With ActiveCell.Characters(Start:=34, Length:=36).Font
.FontStyle = "Negrito"
End With
With ActiveCell.Characters(Start:=37, Length:=39).Font
.FontStyle = "Normal"
End With
With ActiveCell.Characters(Start:=40, Length:=42).Font
.FontStyle = "Negrito"
End With
With ActiveCell.Characters(Start:=43, Length:=45).Font
.FontStyle = "Normal"
End With
With ActiveCell.Characters(Start:=46, Length:=48).Font
.FontStyle = "Negrito"
End With
End Sub
Gostaria de saber os códigos das cores das funções .Color e .ThemeColor e também como posso selecionar mais de uma célula ao mesmo tempo e não apenas a B2.
Postado : 14/11/2016 4:16 pm