TextBoxta Delete ile sildiğim zaman işlem yapmıyor

Katılım
8 Haziran 2007
Mesajlar
761
Excel Vers. ve Dili
excel- 2003 Türkçe
Private Sub CommandButton2_Click()
Sheets("Personel_Bilgi").Select
If TextBox1.Value = "" Then
MsgBox "Personel No'su Boş Olamaz..!", vbCritical
TextBox1.SetFocus
Exit Sub
End If
If MsgBox("DEĞİŞİKLİK YAPMAK İSTYORMUSUNUZ.?", vbQuestion) = vbNo Then
TextBox1.SetFocus
Exit Sub
End If
Set k = Range("B11:B65536").Find(TextBox1.Value, , xlValues, xlWhole)
If Not k Is Nothing Then
For i = 4 To 7
If Not IsNumeric(Controls("TextBox" & i)) Then Controls("TextBox" & i) = 0
Cells(k.Row, "D").Value = TextBox2.Value
Cells(k.Row, "E").Value = TextBox3.Value

Cells(k.Row, "BA").Value = ComboBox6.Value
MsgBox "Değişiklik Yapıldı"
For j = 1 To 32
Controls("TextBox" & j) = ""
Next

For l = 1 To 6
Controls("ComboBox" & l) = ""
Next

For Y = 40 To 51
Controls("textbox" & Y) = ""
Next


Exit Sub
Next i
Else
MsgBox "Değitirelecek Veri Bulunamadı.!"
End If
End Sub



Sorgu çağır ile Form üzerindeki TextBoxlara gelen verileri DELETE ile silip kaydet dediğimde hata veriyor. Sıfır da yazmak istemiyorum.
 
Katılım
8 Haziran 2007
Mesajlar
761
Excel Vers. ve Dili
excel- 2003 Türkçe
hangi satır derken ben uzun olmasın diye hepsini almadım. 1 den 32 ye kadar TextBoxlar var.

Ama sorun zannedersem aşağıdaki kodlardan başlıyor. Yani 21 i denedim sorun vermedi. ama 22 den itibaren sorun veriyor. Yani hücrede hiçbir şey yokken veri girdiğimde excele kaydediyor ama sorgu ile çağırıp aynı veriyi delete ile sildiğimde excel sayfasından silmiyor.


If IsNumeric(TextBox21.Value) Then
Cells(k.Row, "AH").Value = CDbl(TextBox21.Value)
End If
If IsNumeric(TextBox22.Value) Then
Cells(k.Row, "AI").Value = CDbl(TextBox22.Value)
End If
If IsNumeric(TextBox23.Value) Then
Cells(k.Row, "AJ").Value = CDbl(TextBox23.Value)
End If
If IsNumeric(TextBox24.Value) Then
Cells(k.Row, "AK").Value = CDbl(TextBox24.Value)
End If
If IsNumeric(TextBox25.Value) Then
Cells(k.Row, "AL").Value = CDbl(TextBox25.Value)
End If
If IsNumeric(TextBox26.Value) Then
Cells(k.Row, "AM").Value = CDbl(TextBox26.Value)
End If
If IsNumeric(TextBox27.Value) Then
Cells(k.Row, "AN").Value = CDbl(TextBox27.Value)
End If
If IsNumeric(TextBox28.Value) Then
Cells(k.Row, "AP").Value = CDbl(TextBox28.Value)
End If
If IsNumeric(TextBox29.Value) Then
Cells(k.Row, "AR").Value = CDbl(TextBox29.Value)
End If
If IsNumeric(TextBox9.Value) Then
Cells(k.Row, "W").Value = CDbl(TextBox9.Value)
End If
If IsNumeric(TextBox28.Value) Then
Cells(k.Row, "AP").Value = CDbl(TextBox28.Value)
End If
 

Orion1

Uzman
Uzman
Katılım
1 Mart 2005
Mesajlar
22,254
Excel Vers. ve Dili
Win7 Home Basic TR 64 Bit

Ofis-2010-TR 32 Bit
Aşağıdaki gibi denermisiniz.:cool:
Kod:
If IsNumeric(TextBox21.Value) Then
    Cells(k.Row, "AH").Value = CDbl(TextBox21.Value)
    else
   cells(k.row,"AH").value=textbox21.value
End If
 
Katılım
8 Haziran 2007
Mesajlar
761
Excel Vers. ve Dili
excel- 2003 Türkçe
Gene silmiyor. Textboxtan siliyorum. işlemi tamamlamış gibi gözükuyor ama silmiyor.
 

Orion1

Uzman
Uzman
Katılım
1 Mart 2005
Mesajlar
22,254
Excel Vers. ve Dili
Win7 Home Basic TR 64 Bit

Ofis-2010-TR 32 Bit
Gene silmiyor. Textboxtan siliyorum. işlemi tamamlamış gibi gözükuyor ama silmiyor.
Sanırım 3 numaralı mesajdaki kodları bir butona atadınız.O butonu çalıştırmayınca benim verdiğim kod çalışmaz.
Bu işlem için kodları textbox'ın change olayına yazmalısınız.:cool:
 
Katılım
8 Haziran 2007
Mesajlar
761
Excel Vers. ve Dili
excel- 2003 Türkçe
Hocam özür dilerim Ben "Else" yi atlamışım o yüzden olmuyormuş. Teşekkür ederim.
 
Katılım
8 Haziran 2007
Mesajlar
761
Excel Vers. ve Dili
excel- 2003 Türkçe
Private Sub Kaydet_Click()
son = Sheets("Personel_Bilgi").[B65536].End(3).Row + 1
Set bak = Sheets("Personel_bilgi").Range("B11:B325").Find(TextBox1, lookat:=xlWhole)
If bak Is Nothing Then
MsgBox "Personel_Bilgi sayfasına kayıt yapılacak!"
Else
MsgBox "Bu personel no başkası tarafından kullanılıyor!"
Exit Sub 'eğer veri mükerrer ise işlem sonlandırılır.
End If


Cells(son, 2) = Val(TextBox1.Value)
Cells(son, 4) = TextBox2
Cells(son, 5) = TextBox3
Cells(son, 6) = Val(TextBox4)
Cells(son, 7) = Val(TextBox5)

Bu kodlarla kayıt yaparken TextBoxlar boş ise Excel hücrelerine (0) sıfır koyuyor. Sıfır olmasın boş olsun istiyorum. kolay gelsin hayırlı akşamlar
 

Orion1

Uzman
Uzman
Katılım
1 Mart 2005
Mesajlar
22,254
Excel Vers. ve Dili
Win7 Home Basic TR 64 Bit

Ofis-2010-TR 32 Bit
4 nolu mesajda verdiğim kodlardaki mantığı kullanınız.:cool.
 
Katılım
8 Haziran 2007
Mesajlar
761
Excel Vers. ve Dili
excel- 2003 Türkçe
Hocam bu hız Maaşallah. Ben daha öbür soruya bakmadan halletmişiniz. Neyse ben çıkıyorum. Sizlere kolay gelsin.
 
Üst