Control de cambios
Gracias de antemano por la colaboración que me puedas prestar, la pregunta es la siguiente; tengo la siguiente macro para controlar los cambios en un libro, pero necesito que no mire todo el libro; si no que mire solo una hoja; pero no se como hacerlo.
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim Z As Range
If Sh.Name = "Historico" Then Exit Sub
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("A1:R3000")) Is Nothing Then
Set Z = Range("Historico!A1").CurrentRegion
Range("Historico!A" & Z.Rows.Count + 1).Value = Time
Range("Historico!B" & Z.Rows.Count + 1).Value = Target.Address
Range("Historico!C" & Z.Rows.Count + 1).Value = IIf(Target = "", "DEL", Target.Value)
End If
End Sub
Gracias.
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim Z As Range
If Sh.Name = "Historico" Then Exit Sub
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("A1:R3000")) Is Nothing Then
Set Z = Range("Historico!A1").CurrentRegion
Range("Historico!A" & Z.Rows.Count + 1).Value = Time
Range("Historico!B" & Z.Rows.Count + 1).Value = Target.Address
Range("Historico!C" & Z.Rows.Count + 1).Value = IIf(Target = "", "DEL", Target.Value)
End If
End Sub
Gracias.
1 respuesta
Respuesta
1