• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Soru Excelde Hücredeki değere göre başka hücreye tarih atamak

Katılım
3 Aralık 2015
Mesajlar
12
Excel Vers. ve Dili
2016 Eng/TR
Merhaba,

Aşağıdaki kod ile hücrede "OK" yazdığımda seçtiğim hücreye düzenleme tarihini yazdırıyorum fakat herhangi bir satıra tıkladığımda tarih günün tarihi oluyor.
Otomatik atılan tarihin düzenlenen günün tarihi olmasını istiyorum. Fakat başka gün girdiğimde tarih değişmesi aynı kalsın istiyorum. Yardımcı olabilir misiniz?


Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not Intersect(Target, [J1:N65536]) Is Nothing Then
For i = 1 To 65536
Select Case Cells(i, "J")
Case "OK"
Cells(i, "P") = Format(Date, "dd/mm/yyyy")
Case "ok"
Cells(i, "P") = Format(Date, "dd/mm/yyyy")
Case "Ok"
Cells(i, "P") = Format(Date, "dd/mm/yyyy")

End Select
Next

End If
End Sub
 
Kırmızı yeri ekleyip denermisiniz.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not Intersect(Target, [J1:N65536]) Is Nothing Then
For i = 1 To 65536
If Cells(i, "P")="" Then
Select Case Cells(i, "J")
Case "OK"
Cells(i, "P") = Format(Date, "dd/mm/yyyy")
Case "ok"
Cells(i, "P") = Format(Date, "dd/mm/yyyy")
Case "Ok"
Cells(i, "P") = Format(Date, "dd/mm/yyyy")

End Select
End If
Next

End If
End Sub
 
Kırmızı yeri ekleyip denermisiniz.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not Intersect(Target, [J1:N65536]) Is Nothing Then
For i = 1 To 65536
If Cells(i, "P")="" Then
Select Case Cells(i, "J")
Case "OK"
Cells(i, "P") = Format(Date, "dd/mm/yyyy")
Case "ok"
Cells(i, "P") = Format(Date, "dd/mm/yyyy")
Case "Ok"
Cells(i, "P") = Format(Date, "dd/mm/yyyy")

End Select
End If
Next

End If
End Sub


Desteğiniz için teşekkürler. Şu anda sorunum giderildi. İstediğim gibi çalışıyor.
 
Geri
Üst