Bienvenido a la mayor comunidad de usuarios EXCEL

Regístrate gratis ahora para ver contenidos y descargas sin restricciones!

Regístrate gratis

completar macro fecha estática

jmsc24

Member
Registrado
2 Feb 2019
Mensajes
112
Buenas, copio y pego una macro que me introduce fecha estática cuando introduzco un dato. Funciona bien. Lo que ocurre es que cuando borro un dato y se queda la celda de origen vacia en la celda...
Para poder visualizar el resto de este tema y sus adjuntos:
. Si nunca te has registrado puedes registrarte gratis aquí
. Si ya te has registrado debes
iniciar sesión aquí
 
Última edición:
Solución
Código:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Intersect(Target, Range("AA4:AM38")) Is Nothing Then
   If Not Intersect(Target, Range("AJ" & Target.Row).DirectPrecedents) Is Nothing Then
      If Range("AJ" & Target.Row) = "" Then
         Range("AM" & Target.Row) = ""
      Else
         Range("AM" & Target.Row) = Date
      End If
   End If
End If
Application.EnableEvents = True
End Sub
Código:
If Not Intersect(Target, Range("AL4:AM38")) Is Nothing Then
   If Target = "" then
      Cells(Target.Row, "AQ") =""
   Else
      Cells(Target.Row, "AQ") = Now
   End If
End If
 
Código:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Intersect(Target, Range("AA4:AM38")) Is Nothing Then
   If Not Intersect(Target, Range("AJ" &...
Para poder visualizar el resto de este tema y sus adjuntos:
. Si nunca te has registrado puedes registrarte gratis aquí
. Si ya te has registrado debes
iniciar sesión aquí
 
Última edición:
Volver
Arriba