- Katılım
- 13 May 2019
- Mesajlar
- 303
- Excel Versiyonu
- Excel 2016
- Excel Sürümü
- 64 Bit
- Excel Dili
- Türkçe
Kod:
Dim eski_deger$
Private Sub Worksheet_Change(ByVal Target As Range)
Set sayfa = ThisWorkbook.Sheets("log")
With sayfa
satir = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
.Cells(satir, 1) = Format(Now, "dd.mm.yyyy")
.Cells(satir, 2) = Format(Now, "hh:mm")
.Cells(satir, 3) = ActiveSheet.Name
.Hyperlinks.Add .Cells(satir, 3), "", "=" & .Cells(satir, 3) & "!" & Target.Address(0, 0)
.Cells(satir, 4) = Target.Address(0, 0)
.Hyperlinks.Add .Cells(satir, 4), "", "=" & .Cells(satir, 3) & "!" & .Cells(satir, 4)
.Cells(satir, 5) = eski_deger
.Cells(satir, 6) = Target.Text
.Cells(satir, 7) = Environ("UserName")
End With
End Sub
Ancak ben aynı zamanda Sayfa1 den A sutununda bulunan değişiklik yapılan satırdaki sicili de Log sayfasında A sutununa yazdırmak istiyorum.
Kod:
Dim eski_deger$
Private Sub Worksheet_Change(ByVal Target As Range)
Set sayfa = ThisWorkbook.Sheets("log")
With sayfa
satir = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
.Cells(satir, 1) = "BURAYA SAYFA1 İN A SUTUNDAKİ BİLGİ GELECEK"
.Cells(satir, 2) = Format(Now, "dd.mm.yyyy")
.Cells(satir, 3) = Format(Now, "hh:mm")
.Cells(satir, 4) = ActiveSheet.Name
.Hyperlinks.Add .Cells(satir, 4), "", "=" & .Cells(satir, 4) & "!" & Target.Address(0, 0)
.Cells(satir, 5) = Target.Address(0, 0)
.Hyperlinks.Add .Cells(satir, 5), "", "=" & .Cells(satir, 5) & "!" & .Cells(satir, 5)
.Cells(satir, 6) = eski_deger
.Cells(satir, 7) = Target.Text
'.Cells(satir, 7) = Environ("UserName")
End With
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
eski_deger = Target
End Sub
Ekli dosyalar