Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

asignar condiciones a un rango dinamico

publicado

Buenos dias

 

Tengo una hoja con unas condiciones en una de las celdas, y con una macro quiero que al ejecutarla, se copie las conficiones de la celda F2 al resto de celdas de la columna, pero no hasta el final si no hasta la ultima celda con datos.

Tengo este codigo y funciona, pero me aplica con la condicion de la celda F2, es decir Si f2 es menor que E2 ponte rojo, y en la siguiente fila queria que si F3 es menor que E3 ponte rojo, o si es mayor ponte verde,

 

Adjunto el codigo

 

Sub Condicionar()
    
    Range("F2").Select
    Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$F$2=$E$2"
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    With Selection.FormatConditions(1).Interior
        .PatternColorIndex = xlAutomatic
        .Color = 5296274
        .TintAndShade = 0
    End With
    Selection.FormatConditions(1).StopIfTrue = False
    Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$F$2<$E$2"
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    With Selection.FormatConditions(1).Interior
        .PatternColorIndex = xlAutomatic
        .Color = 255
        .TintAndShade = 0
    End With
    Selection.FormatConditions(1).StopIfTrue = False
    Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$F$2>$E$2"
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    With Selection.FormatConditions(1).Interior
        .PatternColorIndex = xlAutomatic
        .Color = 5296274
        .TintAndShade = 0
    End With
    Selection.FormatConditions(1).StopIfTrue = False
    Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
        "=ESBLANCO($F$2)"
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    With Selection.FormatConditions(1).Interior
        .Pattern = xlNone
        .TintAndShade = 0
    End With
    Selection.FormatConditions(1).StopIfTrue = False
    
    Selection.AutoFill Destination:=Range("F2: F" & Range("E" & Rows.Count) _
    .End(xlUp) _
    .Row)

 

Featured Replies

publicado
  • Autor

Ya esta solucionado, gracias igualmente

 

Un saludo

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.