como puedo simplificar esta macro para poner color diferente a cada letra
puede ser un color aletorio para cada letra
puede ser un color aletorio para cada letra
VBA Code:
Sub colorear()
'
'
'
'
Range("A1").Select
ActiveCell.FormulaR1C1 = "qwertyuiopasdfghjklñzxcvbnm"
Range("A2").Select
ActiveWindow.SmallScroll Down:=-21
Range("A1").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Range("A1").Select
ActiveCell.FormulaR1C1 = "qwertyuiopasdfghjklñzxcvbnm"
With ActiveCell.Characters(Start:=1, Length:=0).Font
.Name = "Arial Black"
.FontStyle = "Normal"
.Size = 20
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
With ActiveCell.Characters(Start:=1, Length:=1).Font
.Name = "Arial Black"
.FontStyle = "Normal"
.Size = 20
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorAccent1
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
With ActiveCell.Characters(Start:=2, Length:=1).Font
.Name = "Arial Black"
.FontStyle = "Normal"
.Size = 20
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.Color = -16711681
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
With ActiveCell.Characters(Start:=3, Length:=1).Font
.Name = "Arial Black"
.FontStyle = "Normal"
.Size = 20
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.Color = -16776961
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
With ActiveCell.Characters(Start:=4, Length:=1).Font
.Name = "Arial Black"
.FontStyle = "Normal"
.Size = 20
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.Color = -16711681
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
With ActiveCell.Characters(Start:=5, Length:=1).Font
.Name = "Arial Black"
.FontStyle = "Normal"
.Size = 20
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.Color = -4165632
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
With ActiveCell.Characters(Start:=6, Length:=1).Font
.Name = "Arial Black"
.FontStyle = "Normal"
.Size = 20
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight2
.TintAndShade = 0.399975585192419
.ThemeFont = xlThemeFontNone
End With
With ActiveCell.Characters(Start:=7, Length:=1).Font
.Name = "Arial Black"
.FontStyle = "Normal"
.Size = 20
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.149998474074526
.ThemeFont = xlThemeFontNone
End With
With ActiveCell.Characters(Start:=8, Length:=20).Font
.Name = "Arial Black"
.FontStyle = "Normal"
.Size = 20
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
Range("B1").Select
End Sub
Last edited by a moderator: