- Katılım
- 22 Aralık 2010
- Mesajlar
- 17
- Excel Vers. ve Dili
- excell 2016
Private Sub Worksheet_Change(ByVal Target As Range)
Dim bul As Range
Dim trh As Date
Dim CsutunTarih As Date
Dim blg As Range
With ThisWorkbook.Sheets("T1")
If (Target.Column = 3 Or Target.Column = 5) And Target.Row >= 1 Then
If IsDate(Cells(Target.Row, "c")) And Len(Cells(Target.Row, "E") & "") > 0 Then
SonStn = .Cells(1, .Columns.Count).End(xlToLeft).Column
Set bul = .Range("B1:" & .Cells(1, SonStn).Address).Find(Year(Cells(Target.Row, "C").Value), , , 1)
Set kaydir = .Range("A:A").Find(Cells(Target.Row, "E").Value, , , 1)
If (Not bul Is Nothing) And (Not kaydir Is Nothing) Then Cells(Target.Row, "F").Value = .Cells(kaydir.Row, bul.Column).Value
End If
End If
End With
Set bul = Nothing
Exit Sub
On Error Resume Next
If Target.Count > 1 Then Exit Sub
Set blg = Range("c:c")
If Intersect(Target, blg) Is Nothing Then Exit Sub
If Len(Target) = 8 Then
If InStr(Target, ".") = 0 Then Target = Format(Left(Target, 2) & "." & Mid(Target, 3, 2) & "." & Right(Target, 4), "dd/mm/yyyy;@")
ElseIf Len(Target) = 7 Then
If InStr(Target, ".") = 0 Then Target = Format(Left(Target, 1) & "." & Mid(Target, 2, 2) & "." & Right(Target, 4), "dd/mm/yyyy;@")
End If
End Sub
KODUNU ÇALIŞTIRAMIYORUM
Dim bul As Range
Dim trh As Date
Dim CsutunTarih As Date
Dim blg As Range
With ThisWorkbook.Sheets("T1")
If (Target.Column = 3 Or Target.Column = 5) And Target.Row >= 1 Then
If IsDate(Cells(Target.Row, "c")) And Len(Cells(Target.Row, "E") & "") > 0 Then
SonStn = .Cells(1, .Columns.Count).End(xlToLeft).Column
Set bul = .Range("B1:" & .Cells(1, SonStn).Address).Find(Year(Cells(Target.Row, "C").Value), , , 1)
Set kaydir = .Range("A:A").Find(Cells(Target.Row, "E").Value, , , 1)
If (Not bul Is Nothing) And (Not kaydir Is Nothing) Then Cells(Target.Row, "F").Value = .Cells(kaydir.Row, bul.Column).Value
End If
End If
End With
Set bul = Nothing
Exit Sub
On Error Resume Next
If Target.Count > 1 Then Exit Sub
Set blg = Range("c:c")
If Intersect(Target, blg) Is Nothing Then Exit Sub
If Len(Target) = 8 Then
If InStr(Target, ".") = 0 Then Target = Format(Left(Target, 2) & "." & Mid(Target, 3, 2) & "." & Right(Target, 4), "dd/mm/yyyy;@")
ElseIf Len(Target) = 7 Then
If InStr(Target, ".") = 0 Then Target = Format(Left(Target, 1) & "." & Mid(Target, 2, 2) & "." & Right(Target, 4), "dd/mm/yyyy;@")
End If
End Sub
KODUNU ÇALIŞTIRAMIYORUM