History
Solved
juer31
Posted messages
120
Status
Member
-
michel_m Posted messages 18903 Registration date Status Contributor Last intervention -
michel_m Posted messages 18903 Registration date Status Contributor Last intervention -
Bonjour,
I have this code that logs all my cell changes but I would like to log only column L
Can someone help me?
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim col As Range
Set col = Columns("L")
If Not Intersect(Target, col) Is Nothing Then
Target.Offset(1, 0).Select
celaddress = Target.Address
colonne = Target.Column
UserForm1.Show
Target.Offset(1, 0).Select
End If
End Sub
Sub test_UserName()
Dim Nom As String
Nom = Environ("USERNAME")
MsgBox Nom
End Sub
Private Sub WorkSheet_Change(ByVal Target As Range)
If Target.Count <> 1 Then Exit Sub
If Target = "" Then Exit Sub
If Target.Column = 12 Then
r = Target.Address & ")" & Date & " - " & Target.Value & " - " & Environ("username")
With Worksheets("historiques")
dl = .Cells(Rows.Count, 1).End(xlUp).Row
If .Cells(dl, 1) <> r Then .Cells(dl + 1, 1) = r
End With
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells(1, 9).Value = ActiveCell.Value
End Sub
I have this code that logs all my cell changes but I would like to log only column L
Can someone help me?
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim col As Range
Set col = Columns("L")
If Not Intersect(Target, col) Is Nothing Then
Target.Offset(1, 0).Select
celaddress = Target.Address
colonne = Target.Column
UserForm1.Show
Target.Offset(1, 0).Select
End If
End Sub
Sub test_UserName()
Dim Nom As String
Nom = Environ("USERNAME")
MsgBox Nom
End Sub
Private Sub WorkSheet_Change(ByVal Target As Range)
If Target.Count <> 1 Then Exit Sub
If Target = "" Then Exit Sub
If Target.Column = 12 Then
r = Target.Address & ")" & Date & " - " & Target.Value & " - " & Environ("username")
With Worksheets("historiques")
dl = .Cells(Rows.Count, 1).End(xlUp).Row
If .Cells(dl, 1) <> r Then .Cells(dl + 1, 1) = r
End With
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells(1, 9).Value = ActiveCell.Value
End Sub
1 answer
Hello
An example with 2 spreadsheets: Dissident.xls where changes are made to a column (L) and are reported (who, what, before- after, when date-time)
in the spreadsheet Bigbrother.xls
https://mon-partage.fr/f/xTSWzClK/
Be careful to extract the zip and not to open it
If I find it (..) and if you're interested, we can report it in a text file
--
Michel
An example with 2 spreadsheets: Dissident.xls where changes are made to a column (L) and are reported (who, what, before- after, when date-time)
in the spreadsheet Bigbrother.xls
https://mon-partage.fr/f/xTSWzClK/
Be careful to extract the zip and not to open it
If I find it (..) and if you're interested, we can report it in a text file
--
Michel