- Katılım
- 3 Temmuz 2009
- Mesajlar
- 81
- Excel Vers. ve Dili
- 2010 pro plus türkçe
Tarih yazarken sadece gün girildiğine ay ve yıl otomatik tamamlansın. Bugün 12.05.2019. Sadece "12" yazıp, enter tıklayınca tarihi 12.05.2019 şeklinde otomatik tamamlasın.
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, [A:A]) Is Nothing Then Exit Sub
If IsNumeric(Target.Value) Then
Application.EnableEvents = False
Target.Value = DateSerial(Year(Date), Month(Date), Target.Value)
Application.EnableEvents = True
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, [A:A]) Is Nothing Then Exit Sub
If IsNumeric(Target.Text) Then
Application.EnableEvents = False
Target.Text = DateSerial(Year(Date), Month(Date), Target.Value)
Application.EnableEvents = True
End If
End Sub
Kod:Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, [A:A]) Is Nothing Then Exit Sub If IsNumeric(Target.Text) Then Application.EnableEvents = False Target.Text = DateSerial(Year(Date), Month(Date), Target.Value) Application.EnableEvents = True End If End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, [A:A]) Is Nothing Then Exit Sub
Application.EnableEvents = False
If IsDate(Target.Value) = True Then
Target.Value = DateSerial(Year(Date), Month(Date), Day(Target.Value) + 1)
ElseIf IsNumeric(Target.Value) Then
Target.Value = DateSerial(Year(Date), Month(Date), Target.Value)
End If
Application.EnableEvents = True
End Sub
Bu söze şapka çıkarılır.Buradan çıkardığım sonuç, tarihi tarih gibi girmek.
Korhan Bey zaten konuyu canlandırana sordum.@Erkan Akayay,
Soru 2019 yılında ilk sorulduğunda sadece gün girilerek ay ve yılın otomatik tamamlanması istenmiş. Başka detay verilmemiş. Bu durumda ben ay ve yılı aktif dönem diye yorumladım.