Colores

Páginas: 2 (320 palabras) Publicado: 21 de marzo de 2010
En el rango d10 a ew100 tengo detallados diferentes datos (números del 1 al 20). Y necesito colorear las celdas de acuerdo al dato que tengan. Es decir, si en la celda dice 1 que la pinte de verde,si dice 2 de azul... y así sucesivamente
El formato condicional del excel, admite solo tres variables. Por lo que, necesitaria crear una macro que admitiera como mínimo 20 variables.
A otraconsultante la ayudaste con esta macro...
c = InputBox("Indique la Columna")
a = InputBox("Desde")
b = InputBox("Hasta")
For x = Int(a) To Int(b)
Range(c & LTrim(Str(x))).Select

If Selection.Value ="1" Then
With Selection.Interior
.ColorIndex = 17
.Pattern = xlSolid
End With
Else
If Selection.Value = "2" Then
With Selection.Interior
.ColorIndex = 18
.Pattern = xlSolid
End With
Else
IfSelection.Value = "3" Then
With Selection.Interior
.ColorIndex = 19
.Pattern = xlSolid
End With
Else
If Selection.Value = "4" Then
With Selection.Interior
.ColorIndex = 20
.Pattern = xlSolidEnd With
Else
If Selection.Value = "5" Then
With Selection.Interior
.ColorIndex = 21
.Pattern = xlSolid
End With
Else
If Selection.Value = "6" Then
With Selection.Interior
.ColorIndex = 22.Pattern = xlSolid
End With
Else
If Selection.Value = "7" Then
With Selection.Interior
.ColorIndex = 23
.Pattern = xlSolid
End With
Else
If Selection.Value = "8" Then
WithSelection.Interior
.ColorIndex = 24
.Pattern = xlSolid
End With
Else
If Selection.Value = "9" Then
With Selection.Interior
.ColorIndex = 25
.Pattern = xlSolid
End With
Else
If Selection.Value = "10" ThenWith Selection.Interior
.ColorIndex = 26
.Pattern = xlSolid
End With
Else
If Selection.Value = "11" Then
With Selection.Interior
.ColorIndex = 27
.Pattern = xlSolid
End With
End If
End IfEnd If
End If
End If
End If
End If
End If
End If
End If
End If
Next x
End Sub

Esta selecciona una columna... yo necesito la misma pero que tome las columnas desde la "D" hasta EW"....
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Colores
  • El color
  • El Color
  • Color
  • Color
  • Color
  • Colores
  • el color

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS