Erkan Akayay yazdı:Ben de emin olamadım. Ben miyim ki?
Hoş geldin Erkan abi.
![öptüm [op]](./images/smilies/inlove.gif)

Erkan Akayay yazdı:Ben de emin olamadım. Ben miyim ki?
![]() |
Private EskiDeger As Variant
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 8 And Target.Row > 5 Then
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Sheets("CIKIS").Range("G" & Sheets("CIKIS").Range("G65536").End(3).Row + 1) = Target.Offset(0, -1).Value
End Sub
ahmetilhan282 yazdı:Dosyanıza log adında bir sayfa ekleyin. Module kodu:
- Kod: Tümünü seç
Public eski_deger$
ThisWorkbook kodu:
- Kod: Tümünü seç
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
eski_deger = Target.Text
End Sub
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Text <> eski_deger And Sh.Name <> "log" Then
With ThisWorkbook.Sheets("log")
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) = Sh.Name & "!" & Target.Address(0, 0)
.Hyperlinks.Add .Cells(satir, 3), "", "=" & .Cells(satir, 3)
.Cells(satir, 4) = eski_deger
.Cells(satir, 5) = Target.Text
.Cells(satir, 6) = Environ("UserName")
End With
End If
End Sub
ahmetilhan282 yazdı:otobus yazdı:"log" çalışma sayfasında, değişen çalışma sayfası ve değişen hücreyi ayırmak mümkün müdür? "log" da ilgili hücreye tıkladığımda veya çalışma sayfasına tıkladığımda o hücreye gidecek şekilde.
"Workbook_SheetChange" kodlarını aşağıdaki şekilde güncelleyin.
- Kod: Tümünü seç
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Text <> eski_deger And Sh.Name <> "log" Then
With ThisWorkbook.Sheets("log")
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) = Sh.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 If
End Sub
judlas yazdı:".Cells(satir, 5) = eski_deger" bu kod aslında bu işlemi yapıyor olması gerekiyor ama nedense hücredeki eski değeri log sheetinde 5. sütunda yazmıyor
Public eski_deger$
metehan8001 yazdı:judlas yazdı:".Cells(satir, 5) = eski_deger" bu kod aslında bu işlemi yapıyor olması gerekiyor ama nedense hücredeki eski değeri log sheetinde 5. sütunda yazmıyor
Merhaba, sayfanız da kod bölümüne makro için bir tane modül ekleyin ve aşağıdaki yazın.
- Kod: Tümünü seç
Public eski_deger$
metehan8001 yazdı:Log sayfasının kod bölümü boş olacaktır. Thisworkbook ile modüle yazaksınız sadece.
Private Sub Workbook_Open()
Set log = New Excel.Application
log.Visible = False
log.Workbooks.Open ThisWorkbook.Path & "\log.xlsx"
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
eski_deger = Target.Text
End Sub
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Text <> eski_deger Then
With log.Workbooks("log.xlsx").Sheets(1)
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) = Sh.Name & "!" & Target.Address(0, 0)
.Cells(satir, 4) = eski_deger
.Cells(satir, 5) = Target.Text
.Cells(satir, 6) = Environ("UserName")
End With
End If
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
log.Workbooks("log.xlsx").Close True
log.Quit
End Sub
.Cells(satir, 6) = Environ("UserName")
.Cells(satir, 6) = strMsg
Sub local_ip()
strMsg = Empty
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set IPConfigSet = objWMIService.ExecQuery("Select IPAddress from Win32_NetworkAdapterConfiguration where IPEnabled = 'True'")
For Each IPConfig In IPConfigSet
If Not IsNull(IPConfig.IPAddress) Then
For i = LBound(IPConfig.IPAddress) To UBound(IPConfig.IPAddress)
If Not InStr(IPConfig.IPAddress(i), ":") > 0 Then
strMsg = strMsg & IPConfig.IPAddress(i) & vbCrLf
End If
Next
End If
Next
End Sub
Enes Recep BAĞ yazdı:bu satırı;
- Kod: Tümünü seç
.Cells(satir, 6) = Environ("UserName")
yazın.
- Kod: Tümünü seç
.Cells(satir, 6) = strMsg
Ayrıca, modül veya userform hangisindeyse kodlarınız, uygun bir alana aşağıdaki kodları yazıp deneyin.
- Kod: Tümünü seç
Sub local_ip()
strMsg = Empty
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set IPConfigSet = objWMIService.ExecQuery("Select IPAddress from Win32_NetworkAdapterConfiguration where IPEnabled = 'True'")
For Each IPConfig In IPConfigSet
If Not IsNull(IPConfig.IPAddress) Then
For i = LBound(IPConfig.IPAddress) To UBound(IPConfig.IPAddress)
If Not InStr(IPConfig.IPAddress(i), ":") > 0 Then
strMsg = strMsg & IPConfig.IPAddress(i) & vbCrLf
End If
Next
End If
Next
End Sub
farukfar yazdı:Bu konu bana ilham kaynağı oldu ve ben biraz "log" kaydını güncelledim, bir tek eksiği kaldı diye düşünüyorum, dolu hücre silindiği zaman durumunu="sildi." yapamadım;
Boş hücreye veri girişinde durum="yazdı."
Dolu hücredeki veri değişince durum="olarak değiştirdi."
Dolu hücredeki veri silinince durum="sildi." ; yapamadım![]()
Umarım faydalı olur iyi forumlar.
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
kodunun hemen alt satırına aşağıdaki kodu yazmanız yeterlidir.If IsEmpty(Target.Value) Then Durum = "sildi"
Feyzullah yazdı:BuÇalışmaKitabı kod bölümündePrivate Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
kodunun hemen alt satırına aşağıdaki kodu yazmanız yeterlidir.
- Kod: Tümünü seç
If IsEmpty(Target.Value) Then Durum = "sildi"
@Feyzullah
şimdi güzel oldu.
farukfar yazdı:Feyzullah yazdı:BuÇalışmaKitabı kod bölümündePrivate Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
kodunun hemen alt satırına aşağıdaki kodu yazmanız yeterlidir.
- Kod: Tümünü seç
If IsEmpty(Target.Value) Then Durum = "sildi"
Teşekkürler@Feyzullah
şimdi güzel oldu.
Bu forumu görüntüleyenler: Kayıtlı kullanıcı yok ve 1 misafir