Combobox'dan veri seçip işlem nasıl yapılır

Katılım
24 Mayıs 2009
Mesajlar
168
Excel Vers. ve Dili
2003 türkçe
Arkadaşlar bir çalışma yapıyorum ama bir yerde takıldım ilgilenirseniz sevinirim
 

Ekli dosyalar

İ

İhsan Tank

Misafir
Arkadaşlar bir çalışma yapıyorum ama bir yerde takıldım ilgilenirseniz sevinirim
merhaba
userform'un kod bölümüne
Kod:
Dim sat As String
Private Sub ComboBox1_Click()
sat = ComboBox1.ListIndex + 5
TextBox1.Text = Sheets("Sayfa1").Range("I" & sat).Value
TextBox2.Text = Sheets("Sayfa1").Range("F" & sat).Value
TextBox3.Text = Sheets("Sayfa1").Range("G" & sat).Value
TextBox4.Text = Sheets("Sayfa1").Range("E" & sat).Value
TextBox5.Text = Sheets("Sayfa1").Range("D" & sat).Value
TextBox6.Text = Sheets("Sayfa1").Range("H" & sat).Value
End Sub
Private Sub CommandButton1_Click()
If ComboBox1.Text = Empty Then MsgBox "Adı Seçiniz.", vbInformation: Exit Sub
If TextBox1.Text = Empty Then MsgBox "Pazar Giriniz.", vbInformation: Exit Sub
If TextBox2.Text = Empty Then MsgBox "Akşam Mesai Giriniz.", vbInformation: Exit Sub
If TextBox3.Text = Empty Then MsgBox "Çalışmadığı Gün Giriniz.", vbInformation: Exit Sub
If TextBox4.Text = Empty Then MsgBox "İşe Geç Geldiği Gün Giriniz.", vbInformation: Exit Sub
If TextBox5.Text = Empty Then MsgBox "Avans Giriniz.", vbInformation: Exit Sub
If TextBox6.Text = Empty Then MsgBox "Kalan Giriniz.", vbInformation: Exit Sub
'sat = ComboBox1.ListIndex + 1
Cevap = MsgBox("Kaydetmek İstediğinize Emin Misiniz!", vbYesNo)
If Cevap = vbNo Then Exit Sub
Sheets("Sayfa1").Select
ComboBox1.RowSource = ""
Cells(sat, "A") = ComboBox1.Value
Cells(sat, "I") = TextBox1.Value
Cells(sat, "F") = TextBox2.Value
Cells(sat, "G") = TextBox3.Value
Cells(sat, "E") = TextBox4.Value
Cells(sat, "D") = TextBox5.Value
Cells(sat, "H") = TextBox6.Value
UserForm_Initialize
End Sub
Private Sub CommandButton2_Click()
'sat = ComboBox1.ListIndex + 1
Cevap = MsgBox("Silmek İstediğinize Emin Misiniz!", vbYesNo)
If Cevap = vbNo Then Exit Sub
Sheets("Sayfa1").Select
ComboBox1.RowSource = ""
Cells(sat, "A") = ComboBox1.Value
Cells(sat, "I") = ""
Cells(sat, "F") = ""
Cells(sat, "G") = ""
Cells(sat, "E") = ""
Cells(sat, "D") = ""
Cells(sat, "H") = ""
UserForm_Initialize
End Sub

Private Sub UserForm_Initialize()
If ComboBox1.Tag = "Yeni" Then ComboBox1.TopIndex = ComboBox1.ListCount + 1
ComboBox1.RowSource = "Sayfa1!A5:A" & Sheets("Sayfa1").Range("A65536").End(xlUp).Row
End Sub
bu kodu yapıştırarak dener misiniz.

eki inceleyiniz
 

Ekli dosyalar

Katılım
16 Kasım 2009
Mesajlar
42
Excel Vers. ve Dili
office 2007 ingilizce versiyon
merhaba ihsan bey

benim bir yerde takıldım yardımcı olabilirmisiniz. ekteki dosyada gerekli açıklamayı yaptım. yardımınızı rica ederim.
 

Ekli dosyalar

Üst