girilen değeri tarihe çevirmesini nasıl engellerim?

Katılım
25 Temmuz 2006
Mesajlar
145
Excel Vers. ve Dili
office 2007
arkadaşlar STr olarak denedim olmadı.kodlar aşağıda



Private Sub CommandButton1_Click()

Dim c As Range
Dim SonSat As Long
Sheets("A").Select

Set c = Range("A:A").Find(TextBox1.Value, LookIn:=xlValues)
If Not c Is Nothing Then
Cells(c.Row, "D") = CDate(TextBox2.Value)
Else
Evet = MsgBox("Aranan Değer Bulunamadı, Sona Ekleyim mi?", vbYesNo)
SonSat = [A65536].End(3).Row + 1
If Evet = vbYes Then
Cells(SonSat, "A") = TextBox1.Value
Cells(SonSat, "D") = CDate(TextBox2.Value)
End If
End If

End Sub

Private Sub UserForm_Click()

End Sub
 
Cells(SonSat, "D") = CDate(TextBox2.Value)
satırında
Cells(SonSat, "D") = TextBox2.Value

dener misiniz ?
 
düzelttim bu sefer de hiç birşey yapmadı.tanımlarda mı bir hata eksiklik var acaba.istediğim şey A satırındaki değeri bulup aynı satırdaki D sütununa textbox2'deki değeri girsin.

edit
hücrede veri varsa değiştirmiyor.


Private Sub CommandButton1_Click()

Dim c As Range
Dim SonSat As Long
Sheets("A").Select

Set c = Range("A:A").Find(TextBox1.Value, LookIn:=xlValues)
If Not c Is Nothing Then
Cells(c.Row, "D") = TextBox2.Value
Else
Evet = MsgBox("Aranan Değer Bulunamadı, Sona Ekleyim mi?", vbYesNo)
SonSat = [A65536].End(3).Row + 1
If Evet = vbYes Then
Cells(SonSat, "A") = TextBox1.Value
Cells(SonSat, "D") = TextBox2.Value


End If
End If

End Sub

Private Sub UserForm_Click()

End Sub
 
Merhaba,

textboxa tarihi ben şöyle giriyorum ve aşağıdaki kodları kullanıyorum.

g/a/y yada
gg/aa/yy
gg-aa-yy gibi

Kod:
Cells(SonSat, "D") = CDbl(CDate(TextBox2.Value))
 
Geri
Üst