Userform Üzerinde Kaydedince sayı karakteri bozuluyor

Katılım
8 Haziran 2007
Mesajlar
761
Excel Vers. ve Dili
excel- 2003 Türkçe
Cells(k.Row, "AO").Value = TextBox28.Value

form üzerinde sorgu çalıştırım TextBoxlara veriler geliyor. Bazılarında değişiklik yapıoyrum tekrar kaydedince yukarıdaki kod için sayıyı sola yaslıyor ve toplama işlemi yapınca bu sayı toplamda gözükmüyor.


aşağıda ki şekilde ise sayı sağa yaslı olarak yani normal yerinde ve ondalıksız olarak yani ( 68,45 ) 68 olarak gözüküyor. bu şekilde toplama işleminde gözüküyor.


Cells(k.Row, "AO").Value = Val(TextBox28.Value)

kaydedince neden karakter olarak ve hücre içerisinde yeri değişiyor (yani sağa dayalı ve sola dayalı) ve ondalık kısmı neden gözükmüyür.
 

Levent Menteşoğlu

Administrator
Yönetici
Admin
Katılım
13 Ekim 2004
Mesajlar
16,057
Excel Vers. ve Dili
Excel 2010-32 bit-Türkçe
Excel 365 -32 bit-Türkçe
Sola dayanması verinin hücreye metin olarak aktarılmasından kaynaklanıyor. Veriyi aşağıdaki gibi aktarın.

Kod:
Cells(k.Row, "AO").Value = [B][COLOR=red]cdbl[/COLOR][/B](TextBox28.Value)
 
Katılım
8 Haziran 2007
Mesajlar
761
Excel Vers. ve Dili
excel- 2003 Türkçe
teşekkür ederim. Ellerinize sağlık. hayırlı akşamlar
 
Katılım
8 Haziran 2007
Mesajlar
761
Excel Vers. ve Dili
excel- 2003 Türkçe
Sayın Levent bey o gün bir sorun görmemiştim ama şuan bir hata veriyor. Hata nedeni ise
Cells(k.Row, "AI").Value = TextBox21.Value
böyle olan kodu ben aşağıdaki gibi değiştirdim. değiştirmemin nedeni ise girilen tutarı toplamda hesaba katmıyor. yani yokmuş gibi oluyordu.


Cells(k.Row, "AI").Value = cdbl(TextBox21.Value)

bu kod ile toplama işlemindeki sorun ortadan kalktı fakat TextBox21 boş iken hata veriyor.
 

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
Sayın Levent bey o gün bir sorun görmemiştim ama şuan bir hata veriyor. Hata nedeni ise
Cells(k.Row, "AI").Value = TextBox21.Value
böyle olan kodu ben aşağıdaki gibi değiştirdim. değiştirmemin nedeni ise girilen tutarı toplamda hesaba katmıyor. yani yokmuş gibi oluyordu.


Cells(k.Row, "AI").Value = cdbl(TextBox21.Value)

bu kod ile toplama işlemindeki sorun ortadan kalktı fakat TextBox21 boş iken hata veriyor.
Aşağıdaki kod işinizi görür.:cool:
Kod:
If IsNumeric(TextBox21.Value) Then
    Cells(k.Row, "AI").Value = CDbl(TextBox21.Value)
End If
 
Katılım
8 Haziran 2007
Mesajlar
761
Excel Vers. ve Dili
excel- 2003 Türkçe
Sayın Evren bey KODUN TAMAMI BURDA

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, "F").Value = TextBox4.Value
Cells(k.Row, "G").Value = TextBox5.Value
Cells(k.Row, "H").Value = TextBox6.Value
Cells(k.Row, "I").Value = TextBox7.Value
Cells(k.Row, "p").Value = TextBox8.Value
Cells(k.Row, "J").Value = TextBox9.Value
Cells(k.Row, "AC").Value = TextBox10.Value
Cells(k.Row, "AD").Value = TextBox11.Value
Cells(k.Row, "Q").Value = TextBox12.Value
Cells(k.Row, "R").Value = TextBox13.Value
Cells(k.Row, "T").Value = TextBox14.Value
Cells(k.Row, "V").Value = TextBox15.Value
Cells(k.Row, "X").Value = TextBox16.Value
Cells(k.Row, "AA").Value = TextBox17.Value
Cells(k.Row, "AB").Value = TextBox18.Value
Cells(k.Row, "AF").Value = TextBox19.Value
Cells(k.Row, "AG").Value = TextBox20.Value
Cells(k.Row, "AH").Value = CDbl(TextBox21.Value)
Cells(k.Row, "AI").Value = TextBox22.Value
Cells(k.Row, "AJ").Value = TextBox23.Value
Cells(k.Row, "AK").Value = TextBox24.Value
Cells(k.Row, "AL").Value = TextBox25.Value
Cells(k.Row, "AM").Value = TextBox26.Value
Cells(k.Row, "AN").Value = TextBox27.Value
Cells(k.Row, "AO").Value = CDbl(TextBox28.Value)
Cells(k.Row, "AR").Value = TextBox29.Value
Cells(k.Row, "AV").Value = TextBox30.Value
Cells(k.Row, "AW").Value = TextBox31.Value
Cells(k.Row, "AU").Value = TextBox32.Value
Cells(k.Row, "BK").Value = TextBox40.Value
Cells(k.Row, "BL").Value = TextBox41.Value
Cells(k.Row, "BM").Value = TextBox42.Value
Cells(k.Row, "BN").Value = TextBox43.Value
Cells(k.Row, "BQ").Value = TextBox44.Value
Cells(k.Row, "BR").Value = TextBox45.Value
Cells(k.Row, "BS").Value = TextBox46.Value
Cells(k.Row, "BT").Value = TextBox47.Value
Cells(k.Row, "BU").Value = TextBox48.Value
Cells(k.Row, "BV").Value = TextBox49.Value
Cells(k.Row, "BW").Value = TextBox50.Value
Cells(k.Row, "CE").Value = TextBox51.Value
MsgBox "Değişiklik Yapıldı"
For j = 1 To 32
Controls("TextBox" & j) = ""
Next
For Y = 40 To 51
Controls("textbox" & Y) = ""
Next


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

Bazı veriler metin bazılları ise sayı. Sayı olanlarda sorun çıkıyor.
sizin yazdığınız kodu nereye eklemem lazım
 

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
Sayın Evren bey KODUN TAMAMI BURDA
Bazı veriler metin bazılları ise sayı. Sayı olanlarda sorun çıkıyor.
sizin yazdığınız kodu nereye eklemem lazım
Aşağıdaki şekilde deneyiniz.:cool:
Kod:
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, "F").Value = TextBox4.Value
        Cells(k.Row, "G").Value = TextBox5.Value
        Cells(k.Row, "H").Value = TextBox6.Value
        Cells(k.Row, "I").Value = TextBox7.Value
        Cells(k.Row, "p").Value = TextBox8.Value
        Cells(k.Row, "J").Value = TextBox9.Value
        Cells(k.Row, "AC").Value = TextBox10.Value
        Cells(k.Row, "AD").Value = TextBox11.Value
        Cells(k.Row, "Q").Value = TextBox12.Value
        Cells(k.Row, "R").Value = TextBox13.Value
        Cells(k.Row, "T").Value = TextBox14.Value
        Cells(k.Row, "V").Value = TextBox15.Value
        Cells(k.Row, "X").Value = TextBox16.Value
        Cells(k.Row, "AA").Value = TextBox17.Value
        Cells(k.Row, "AB").Value = TextBox18.Value
        Cells(k.Row, "AF").Value = TextBox19.Value
        Cells(k.Row, "AG").Value = TextBox20.Value
        [B][COLOR="Red"]If IsNumeric(TextBox21.Value) Then
            Cells(k.Row, "AH").Value = CDbl(TextBox21.Value)
        End If   [/COLOR][/B]
        Cells(k.Row, "AI").Value = TextBox22.Value
        Cells(k.Row, "AJ").Value = TextBox23.Value
        Cells(k.Row, "AK").Value = TextBox24.Value
        Cells(k.Row, "AL").Value = TextBox25.Value
        Cells(k.Row, "AM").Value = TextBox26.Value
        Cells(k.Row, "AN").Value = TextBox27.Value
        Cells(k.Row, "AO").Value = CDbl(TextBox28.Value)
        Cells(k.Row, "AR").Value = TextBox29.Value
        Cells(k.Row, "AV").Value = TextBox30.Value
        Cells(k.Row, "AW").Value = TextBox31.Value
        Cells(k.Row, "AU").Value = TextBox32.Value
        Cells(k.Row, "BK").Value = TextBox40.Value
        Cells(k.Row, "BL").Value = TextBox41.Value
        Cells(k.Row, "BM").Value = TextBox42.Value
        Cells(k.Row, "BN").Value = TextBox43.Value
        Cells(k.Row, "BQ").Value = TextBox44.Value
        Cells(k.Row, "BR").Value = TextBox45.Value
        Cells(k.Row, "BS").Value = TextBox46.Value
        Cells(k.Row, "BT").Value = TextBox47.Value
        Cells(k.Row, "BU").Value = TextBox48.Value
        Cells(k.Row, "BV").Value = TextBox49.Value
        Cells(k.Row, "BW").Value = TextBox50.Value
        Cells(k.Row, "CE").Value = TextBox51.Value
                MsgBox "Değişiklik Yapıldı"
        For j = 1 To 32
            Controls("TextBox" & j) = ""
        Next
        For Y = 40 To 51
            Controls("textbox" & Y) = ""
        Next

        
        Exit Sub
    Next i
    Else
    MsgBox "Değitirelecek Veri Bulunamadı.!"
End If
End Sub
 
Katılım
8 Haziran 2007
Mesajlar
761
Excel Vers. ve Dili
excel- 2003 Türkçe
şu anda diyelimki sorgu gir ile veriyi çağırdım. TextBoxlar veri girince onu sayfaya kaydediyor. ama sayfada olan veriyi çağırıp form üzerindeki TextBoxlardan Delete ile sildiğim zaman kaydedince sayfadaki veriler silinmiyor.
 
Üst