Control de cambios
Calvuch, te cuento que tengo una macro para el control de cambios de una base de datos, pero me registra los cambios de todo el libro y solo quiero que me controle los cambios de una sola hoja. Me pudes ayudar por fa.
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 de calvuch
1