polis-53
Altın Üye
- Katılım
- 26 Aralık 2008
- Mesajlar
- 1,118
- Excel Vers. ve Dili
- EXCEL 2016 TÜRKÇE
- Altın Üyelik Bitiş Tarihi
- 23-02-2025
merhaba arkadaşlar aşağıdaki kodu E6:E kolonunada kullanmak istiyorum nasıl bir düzenleme yapmam gerekiyor.
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo Son
Dim Alan As Range, Ay As String, Aylar As Variant, Bul As Byte, Veri As Range
Set Alan = Range("B6:B" & Rows.Count)
Set Alan = Range("E6:E" & Rows.Count)
If Intersect(Target, Alan) Is Nothing Then Exit Sub
Application.EnableEvents = False
Aylar = Array("Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık")
Ay = Range("H1").Value
If Target.Cells.Count = 1 Then
Bul = Application.WorksheetFunction.Match(Ay, Aylar, 0)
If Not IsEmpty(Target.Value) And IsNumeric(Target.Value) And Target.Value > 0 Then
If Month(DateSerial(Year(Date), Bul, Target.Value)) = Bul Then Target.Value = Target.Value & " " & Ay
End If
Else
For Each Veri In Intersect(Selection, Alan)
Bul = Application.WorksheetFunction.Match(Ay, Aylar, 0)
If Not IsEmpty(Veri.Value) And IsNumeric(Veri.Value) And Veri.Value > 0 Then
If Month(DateSerial(Year(Date), Bul, Veri.Value)) = Bul Then Veri.Value = Veri.Value & " " & Ay
End If
Next
End If
Son: Application.EnableEvents = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo Son
Dim Alan As Range, Ay As String, Aylar As Variant, Bul As Byte, Veri As Range
Set Alan = Range("B6:B" & Rows.Count)
Set Alan = Range("E6:E" & Rows.Count)
If Intersect(Target, Alan) Is Nothing Then Exit Sub
Application.EnableEvents = False
Aylar = Array("Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık")
Ay = Range("H1").Value
If Target.Cells.Count = 1 Then
Bul = Application.WorksheetFunction.Match(Ay, Aylar, 0)
If Not IsEmpty(Target.Value) And IsNumeric(Target.Value) And Target.Value > 0 Then
If Month(DateSerial(Year(Date), Bul, Target.Value)) = Bul Then Target.Value = Target.Value & " " & Ay
End If
Else
For Each Veri In Intersect(Selection, Alan)
Bul = Application.WorksheetFunction.Match(Ay, Aylar, 0)
If Not IsEmpty(Veri.Value) And IsNumeric(Veri.Value) And Veri.Value > 0 Then
If Month(DateSerial(Year(Date), Bul, Veri.Value)) = Bul Then Veri.Value = Veri.Value & " " & Ay
End If
Next
End If
Son: Application.EnableEvents = True
End Sub