BUL ile bulunan veriler değiştirilemiyor.

Katılım
31 Ağustos 2005
Mesajlar
1,534
Excel Vers. ve Dili
Excel 2003 - Türkçe
Merhabalar;

Bir userformda ;

Private Sub CommandButton2_Click()
Sheets("liste").Select
Dim bak As Range
For Each bak In Range("B1:B" & WorksheetFunction.CountA(Range("B1:B65000")))
If StrConv(bak.Value, vbUpperCase) = StrConv(ComboBox1.Value, vbUpperCase) Then
bak.Select


TextBox2.Value = ActiveCell.Offset(0, -1).Value
TextBox3.Value = ActiveCell.Offset(0, 0).Value
TextBox4.Value = ActiveCell.Offset(0, 1).Value
TextBox5.Value = ActiveCell.Offset(0, 2).Value
TextBox6.Value = ActiveCell.Offset(0, 3).Value
TextBox7.Value = ActiveCell.Offset(0, 4).Value
TextBox8.Value = ActiveCell.Offset(0, 5).Value
TextBox9.Value = ActiveCell.Offset(0, 6).Value
TextBox10.Value = ActiveCell.Offset(0, 7).Value
TextBox11.Value = ActiveCell.Offset(0, 8).Value
TextBox12.Value = ActiveCell.Offset(0, 9).Value
TextBox13.Value = ActiveCell.Offset(0, 10).Value
TextBox14.Value = ActiveCell.Offset(0, 11).Value
TextBox15.Value = ActiveCell.Offset(0, 12).Value
TextBox16.Value = ActiveCell.Offset(0, 13).Value
TextBox18.Value = ActiveCell.Offset(0, 14).Value
TextBox19.Value = ActiveCell.Offset(0, 15).Value
TextBox20.Value = ActiveCell.Offset(0, 16).Value
TextBox21.Value = ActiveCell.Offset(0, 17).Value
TextBox22.Value = ActiveCell.Offset(0, 18).Value
TextBox23.Value = ActiveCell.Offset(0, 19).Value
TextBox24.Value = ActiveCell.Offset(0, 20).Value
TextBox25.Value = ActiveCell.Offset(0, 21).Value
TextBox26.Value = ActiveCell.Offset(0, 22).Value
TextBox27.Value = ActiveCell.Offset(0, 23).Value
TextBox28.Value = ActiveCell.Offset(0, 24).Value
TextBox29.Value = ActiveCell.Offset(0, 25).Value
TextBox30.Value = ActiveCell.Offset(0, 26).Value
TextBox31.Value = ActiveCell.Offset(0, 27).Value
TextBox32.Value = ActiveCell.Offset(0, 28).Value
TextBox33.Value = ActiveCell.Offset(0, 29).Value
TextBox34.Value = ActiveCell.Offset(0, 30).Value
TextBox35.Value = ActiveCell.Offset(0, 31).Value
TextBox36.Value = ActiveCell.Offset(0, 32).Value
TextBox37.Value = ActiveCell.Offset(0, 33).Value
TextBox38.Value = ActiveCell.Offset(0, 34).Value
TextBox39.Value = ActiveCell.Offset(0, 35).Value
TextBox40.Value = ActiveCell.Offset(0, 36).Value
TextBox41.Value = ActiveCell.Offset(0, 37).Value
Exit Sub
End If
Next bak

MsgBox "Aradığınız isimde bir kayıt bulunamadı"
End Sub


Kodları ile Combo.dan seçtiğim kişiye ait bilgileri TextBox.lara getiriyorum.

Aynı userformda bulunan listbox'a kendiliğinden gelen verilerin üzerine de çift tklayarak, yine TextBox.lara aktarabiliyorum.

ListBox.tan getirdiğim verileri:
Private Sub CommandButton65_Click()
sat = ListBox1.ListIndex + 2
Cevap = MsgBox("DEĞİŞTİRMEK İSTEDİĞİNİZDEN EMİNMİSİNİZ!", vbYesNo, "")
If Cevap = vbNo Then Exit Sub
Sheets("liste").Select
ListBox1.RowSource = ""
Cells(sat, "a") = TextBox2.Value
Cells(sat, "b") = TextBox3.Value
Cells(sat, "c") = TextBox4.Value
Cells(sat, "d") = TextBox5.Value
Cells(sat, "e") = TextBox6.Value
Cells(sat, "f") = TextBox7.Value
Cells(sat, "g") = TextBox8.Value
Cells(sat, "h") = TextBox9.Value
Cells(sat, "ı") = TextBox10.Value
Cells(sat, "j") = TextBox11.Value
Cells(sat, "k") = TextBox12.Value
Cells(sat, "l") = TextBox13.Value
Cells(sat, "m") = TextBox14.Value
Cells(sat, "n") = TextBox15.Value
Cells(sat, "o") = TextBox16.Value
Cells(sat, "p") = TextBox18.Value
Cells(sat, "q") = TextBox19.Value
Cells(sat, "r") = TextBox20.Value
Cells(sat, "s") = TextBox21.Value
Cells(sat, "t") = TextBox22.Value
Cells(sat, "u") = TextBox23.Value
Cells(sat, "v") = TextBox24.Value
Cells(sat, "w") = TextBox25.Value
Cells(sat, "x") = TextBox26.Value
Cells(sat, "y") = TextBox27.Value
Cells(sat, "z") = TextBox28.Value
Cells(sat, "aa") = TextBox29.Value
Cells(sat, "ab") = TextBox30.Value
Cells(sat, "ac") = TextBox31.Value
Cells(sat, "ad") = TextBox32.Value
Cells(sat, "ae") = TextBox33.Value
Cells(sat, "af") = TextBox34.Value
Cells(sat, "ag") = TextBox35.Value
Cells(sat, "ah") = TextBox36.Value
Cells(sat, "aı") = TextBox37.Value
Cells(sat, "aj") = TextBox38.Value
Cells(sat, "ak") = TextBox39.Value
Cells(sat, "al") = TextBox40.Value
Cells(sat, "am") = TextBox41.Value
MsgBox "Borçlu Bilgileri GÜCELLEŞTİRİLMİŞTİR.İyi Çalışmalar Dilerim"

userform_activate
End Sub

Kodu ile DEĞİŞTİREBİLİYORUM.

Fakat Combo'dan seçip bul ile textboxlara gelen veriler üzerinde değiştirme yapmak istediğimde, verinin bulunduğu satır değil de
Başlıkların bulunduğu 1. satırdaki (isim-adres....) bilgileri silerek,
1.satıra düzeltilmiş halini yazmaktadır.

Bu kodlarda ne gibi bir değişiklik ve ilave gereklidir.

Şimdiden Teşekkürler....
 

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
sat = ListBox1.ListIndex + 2


Yukarıdaki gibi bir satırla comboboxtan seçilen verinin hangi satırda olduğunu tanımlamanız gerekir. Bunun içinde yukarıdaki satırın benzerini kullanabilirsiniz.

sat = combobox1.ListIndex + 2
 
Katılım
31 Ağustos 2005
Mesajlar
1,534
Excel Vers. ve Dili
Excel 2003 - Türkçe
Sayın Leventm;

Çok çok teşekkürler..

İyi akşamlar. :icelim:
 
Üst