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.

CODIGO PARA EJECUCION AUTOMATICA DE MACRO SEGÚN CONDICION DE UNA CELDA

publicado

Hola amigos de Ayuda Excel

El día de ayer dos excelentes colaboradores de AE, ante una consulta que hice, me propusieron que era mejor una macro que ejecutara otra macro de manera automática. Uno de los colaboradores me brindó el siguiente código que me funcionó perfectamente:

 Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Row > 4 And _

   Target.Column = 5 And _

   Target(1, 1) <> "" Then

   Call MacroA

End If

End Sub

 Al respecto pensé, que tenía 3 hojas similares que podía aplicar la misma estrategia, pero con la diferencia de que en éstas hojas, la celda que va a determinar la ejecución de la macro contiene una formula y la macro debe activarse cuando la misma sea mayor a cero (0). Intenté adecuarla pero no pude. Así que pido su valiosa colaboración.

Gracias

Anexo ejemplo

ACTIVAR MACRO CUANDO CELDA MAYOR A 0.xlsm

Featured Replies

publicado

En este caso, hay que preguntar por los componentes de la fórmula, una de las formas:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row > 4 Then
   If Target.Address Like "$B$*" Or _
      Target.Address Like "$C$*" Or _
      Target.Address Like "$D$*" Then
      If Range("E" & Target.Row) > 0 Then
         Call Mensaje
      End If
   End If
End If
End Sub

 

Editado el por Antoni

publicado

Buenos días, prueba esto

 

Private Sub Worksheet_Change(ByVal Target As Range)
datos = "a5:e28"
If Not Application.Intersect(Target, Range(datos)) Is Nothing Then
    If Range("E" & Target.Row) > 0 Then
    Call Mensaje
    End If
End If

End Sub

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.