Textbox'tan kayıt sorunu

Katılım
21 Eylül 2005
Mesajlar
184
Excel Vers. ve Dili
ofis 365 İngilizce
Altın Üyelik Bitiş Tarihi
25-10-2024
merhaba arkadaşlar.Belki çok basit ama yaklaşık 4 saattir çözemediğim bir sorunum var:
userform üzerinde textboxlarım var ve bunlara "data" sayfasından veriler çekiyorum.(listbox ile).textboxlar dolduktan sonra bazılarında değişiklik yada boş olanları doldurup güncellemek istiyorum ama çalştır butonuna bastığımda textboxların ilk çağırıldığı halleriyle kaydediyor.yani textboxlara girdipim yeni değerler siliniyor.
teşekkür ederim şimdiden...
 
Katılım
21 Eylül 2005
Mesajlar
184
Excel Vers. ve Dili
ofis 365 İngilizce
Altın Üyelik Bitiş Tarihi
25-10-2024
Private Sub ListBox7_Click()
Dim s1 As Worksheet
Dim t As Integer
ListBox7.Visible = False

Set s1 = Sheets("data")
Image1.Picture = LoadPicture("")
Image2.Picture = LoadPicture("")
Image3.Picture = LoadPicture("")
Image4.Picture = LoadPicture("")

s1.[AW1] = ListBox7.Value
For t = 4 To s1.[b65536].End(3).Row
If s1.Cells(t, "b") = s1.[AW1].Value Then
Sheets("data").[ax1] = Sheets("data").Cells(t, "a") + 3
TextBox1 = ListBox7.Value
TextBox20 = Sheets("data").Cells(t, "a")
TextBox14 = Sheets("data").Cells(t, "c")
TextBox15 = Sheets("data").Cells(t, "D")
TextBox16 = Sheets("data").Cells(t, "e")
TextBox2 = Sheets("data").Cells(t, "f")
TextBox3 = Sheets("data").Cells(t, "g")
TextBox17 = Sheets("data").Cells(t, "h")
TextBox18 = Sheets("data").Cells(t, "ı")
TextBox4 = Sheets("data").Cells(t, "j")
TextBox19 = Sheets("data").Cells(t, "t")
TextBox5 = Sheets("data").Cells(t, "k")
TextBox6 = Sheets("data").Cells(t, "l")
TextBox7 = Sheets("data").Cells(t, "m")
TextBox8.Text = Format(Sheets("data").Cells(t, "n").Value, "dd.mm.yyyy")
TextBox13 = Sheets("data").Cells(t, "o")
TextBox9 = Sheets("data").Cells(t, "p")
TextBox10 = Sheets("data").Cells(t, "q")
TextBox11 = Sheets("data").Cells(t, "r")
TextBox12 = Sheets("data").Cells(t, "s")
End If
Next
bu kodla çağırıyorum ve;
Private Sub CommandButton1_Click()


Dim k As Long


If MsgBox("KAYIT GÜNCELLENSİN Mİ?", vbYesNo) = vbNo Then Exit Sub
Sheets("data").Select
Sheets("data").[AW2] = TextBox1.Value
For k = 4 To Sheets("data").[b65536].End(3).Row
If Sheets("data").Cells(k, "b") = Sheets("data").[AW2].Value Then
Sheets("data").Cells(k, "b") = TextBox1.Value
Sheets("data").Cells(k, "c") = TextBox14.Value
Sheets("data").Cells(k, "d") = TextBox15.Value
Sheets("data").Cells(k, "e") = TextBox16.Value
Sheets("data").Cells(k, "f") = TextBox2.Value
Sheets("data").Cells(k, "g") = TextBox3.Value
Sheets("data").Cells(k, "h") = TextBox17.Value
Sheets("data").Cells(k, "ı") = TextBox18.Value
Sheets("data").Cells(k, "j") = TextBox4.Value
Sheets("data").Cells(k, "k") = TextBox5.Value
Sheets("data").Cells(k, "l") = TextBox6.Value
Sheets("data").Cells(k, "m") = TextBox7.Value
Sheets("data").Cells(k, "n") = TextBox8.Value
Sheets("data").Cells(k, "o") = TextBox13.Value
Sheets("data").Cells(k, "p") = TextBox9.Value
Sheets("data").Cells(k, "q") = TextBox10.Value
Sheets("data").Cells(k, "r") = TextBox11.Value
Sheets("data").Cells(k, "s") = TextBox12.Value
Sheets("data").Cells(k, "t") = TextBox19.Value
End If
Next
MsgBox "Kaydedildi"
End Sub

güncellemek istiyorum
 

Levent Menteşoğlu

Administrator
Yönetici
Admin
Katılım
13 Ekim 2004
Mesajlar
16,058
Excel Vers. ve Dili
Excel 2010-32 bit-Türkçe
Excel 365 -32 bit-Türkçe
Commandbutton1_click prosedürüne ilk satır olarak aşağıdaki satırı ekleyin. Son satırada listboxt7 ye yeniden yükleme yapacak kodları ilave edin.

Kod:
listbox7.rowsource=""
 
Katılım
21 Eylül 2005
Mesajlar
184
Excel Vers. ve Dili
ofis 365 İngilizce
Altın Üyelik Bitiş Tarihi
25-10-2024
çok teşekkür ederim sayın LeventM
 
Üst