- Katılım
- 18 Temmuz 2012
- Mesajlar
- 15
- Excel Vers. ve Dili
- C# VB
Kod:
Private Sub ComboBox1_Change()
TextBox1.SetFocus
lblTitle.Caption = " KFZ Miete " & ComboBox1.Value
Kayitlistele
End Sub
Sub Kayitlistele()
Dim ds As Long
If ComboBox1.Value = Empty Then Exit Sub
ds = Sheets(ComboBox1.Value).Range("B200000").End(xlUp).Row
lstkayitlar.ColumnCount = 8
lstkayitlar.ColumnWidths = "15;100;80;80;80;80;80;80"
lstkayitlar.ColumnHeads = True
x = 0
For i = 1 To Worksheets.Count
x = x + 1
If InStr(Worksheets(i).Name, ComboBox1.Value) > 0 Then
Exit For
End If
Next i
shname = Worksheets(x).Name
lstkayitlar.RowSource = "'" & shname & "'!" & "A3:H" & ds + 1
End Sub
Private Sub CommandButton1_Click()
Dim sor As Byte
Dim ds As Long
If ComboBox1.ListIndex < 0 Or TextBox1.Value = "" Or TextBox2.Value = "" Or TextBox3.Value = "" Or TextBox4.Value = "" Then
frmMesaj.lblMesaj.Caption = "Bilgiler Eksik. Lütfen Kontrol Ediniz!!"
frmMesaj.Show
Exit Sub
End If
ds = Sheets(ComboBox1.Value).Range("B200000").End(xlUp).Row
sor = MsgBox("Talep kaydedilsinmi?", 68, "KAYDET")
If sor = 7 Then Exit Sub
Sheets(ComboBox1.Value).Range("B" & ds + 1).Value = TextBox1.Value
Sheets(ComboBox1.Value).Range("C" & ds + 1).Value = TextBox2.Value
Sheets(ComboBox1.Value).Range("D" & ds + 1).Value = TextBox3.Value
Sheets(ComboBox1.Value).Range("E" & ds + 1).Value = TextBox4.Value
Sheets(ComboBox1.Value).Range("F" & ds + 1).Value = TextBox5.Value
Sheets(ComboBox1.Value).Range("G" & ds + 1).Value = TextBox6.Value
Sheets(ComboBox1.Value).Range("H" & ds + 1).Value = TextBox7.Value
CommandButton2_Click
End Sub
Private Sub CommandButton2_Click()
ComboBox1.ListIndex = -1
TextBox1.Value = ""
TextBox2.Value = ""
TextBox3.Value = ""
TextBox4.Value = Date
TextBox5.Value = ""
TextBox6.Value = Euro
TextBox7.Value = ""
ComboBox1.SetFocus
End Sub
Private Sub CommandButton3_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
sayfaktar
End Sub
Private Sub sayfaktar()
Dim x As Integer
For x = 2 To Sheets.Count
ComboBox1.AddItem (Sheets(x).Name)
Next
TextBox4.Value = Date
End Sub
Merhabalar,
Arkadaşlar kaydettiğim veriler aşağıda listboxt'ta listeleniyor ama ben bu listelenen verileri seçtiğimde textboxt'lara gelmesini güncele butonuna basarsam güncellemesini yapmasını istiyorum. bu konuda hangi kodları kullanabilirim teşekkürler.
