{"id":1483,"date":"2015-04-28T13:06:14","date_gmt":"2015-04-28T21:06:14","guid":{"rendered":"http:\/\/www.auval.com.mx\/notas\/?p=1483"},"modified":"2015-04-28T13:06:14","modified_gmt":"2015-04-28T21:06:14","slug":"macro-para-poner-formatos-condicionales-rojo-amarillo-verde-y-en-blanco-para-celdas-vacias","status":"publish","type":"post","link":"https:\/\/auval.com.mx\/blog\/en\/2015\/04\/28\/macro-para-poner-formatos-condicionales-rojo-amarillo-verde-y-en-blanco-para-celdas-vacias\/","title":{"rendered":"Macro para poner formatos condicionales rojo, amarillo, verde y en blanco para celdas vac\u00edas."},"content":{"rendered":"<p>Este c\u00f3digo les crear\u00e1 formatos condicionales que saldr\u00e1n en rojo para valores menores al 50%, amarillo para mayores o iguales al 50% y menores al 80%, y verde para valores iguales o mayores a 80%. Si la celda est\u00e1 en blanco, no tendr\u00e1 formato.<\/p>\n<pre class=\"lang:default decode:true  \">Sub Tres_colores_R50_A80_V100()\n    ' Asigna un formato condicional de tres colores.\n    ' Rojo &lt; 50%, Amarillo &gt;=50% y &lt;80%, Verde &gt;= 80%.\n    \n    Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _\n        Formula1:=\"=1\"\n    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority\n    With Selection.FormatConditions(1).Font\n        .Color = -16383844\n        .TintAndShade = 0\n    End With\n    With Selection.FormatConditions(1).Interior\n        .PatternColorIndex = xlAutomatic\n        .Color = 13551615\n        .TintAndShade = 0\n    End With\n    Selection.FormatConditions(1).StopIfTrue = False\n    Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual, _\n        Formula1:=\"=0.5\"\n    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority\n    With Selection.FormatConditions(1).Font\n        .Color = -16751204\n        .TintAndShade = 0\n    End With\n    With Selection.FormatConditions(1).Interior\n        .PatternColorIndex = xlAutomatic\n        .Color = 10284031\n        .TintAndShade = 0\n    End With\n    Selection.FormatConditions(1).StopIfTrue = False\n    Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual, _\n        Formula1:=\"=0.8\"\n    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority\n    With Selection.FormatConditions(1).Font\n        .Color = -16752384\n        .TintAndShade = 0\n    End With\n    With Selection.FormatConditions(1).Interior\n        .PatternColorIndex = xlAutomatic\n        .Color = 13561798\n        .TintAndShade = 0\n    End With\n    Selection.FormatConditions(1).StopIfTrue = False\n        Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _\n        Formula1:=\"=\"\"\"\"\"\n    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority\n    Selection.FormatConditions(1).StopIfTrue = True\nEnd Sub\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Este c\u00f3digo les crear\u00e1 formatos condicionales que saldr\u00e1n en rojo para valores menores al 50%, amarillo para mayores o iguales al 50% y menores al 80%, y verde para valores iguales o mayores a 80%. Si la celda est\u00e1 en &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/auval.com.mx\/blog\/en\/2015\/04\/28\/macro-para-poner-formatos-condicionales-rojo-amarillo-verde-y-en-blanco-para-celdas-vacias\/\"> <span class=\"screen-reader-text\">Macro para poner formatos condicionales rojo, amarillo, verde y en blanco para celdas vac\u00edas.<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1483","post","type-post","status-publish","format-standard","hentry","category-office"],"_links":{"self":[{"href":"https:\/\/auval.com.mx\/blog\/en\/wp-json\/wp\/v2\/posts\/1483","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/auval.com.mx\/blog\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/auval.com.mx\/blog\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/auval.com.mx\/blog\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/auval.com.mx\/blog\/en\/wp-json\/wp\/v2\/comments?post=1483"}],"version-history":[{"count":0,"href":"https:\/\/auval.com.mx\/blog\/en\/wp-json\/wp\/v2\/posts\/1483\/revisions"}],"wp:attachment":[{"href":"https:\/\/auval.com.mx\/blog\/en\/wp-json\/wp\/v2\/media?parent=1483"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/auval.com.mx\/blog\/en\/wp-json\/wp\/v2\/categories?post=1483"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/auval.com.mx\/blog\/en\/wp-json\/wp\/v2\/tags?post=1483"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}