Ekli dosyalar
Son düzenleme:
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Private Sub TextBox1_Change()
Cells(ListBox1.ListIndex + 2, 1) = TextBox1
ListBox1.RowSource = Range("A2:C" & Range("A" & Rows.Count).End(xlUp).Row).Address
End Sub
Private Sub TextBox2_Change()
Cells(ListBox1.ListIndex + 2, 2) = TextBox2
ListBox1.RowSource = Range("A2:C" & Range("A" & Rows.Count).End(xlUp).Row).Address
End Sub
Private Sub TextBox3_Change()
Cells(ListBox1.ListIndex + 2, 3) = TextBox3
ListBox1.RowSource = Range("A2:C" & Range("A" & Rows.Count).End(xlUp).Row).Address
End Sub
Label4.Caption = ListBox1.ListIndex
Private Sub CommandButton1_Click()
For txt = 1 To 3
Cells(Label4.Caption + 2, txt) = Controls("TextBox" & txt)
Next
ListBox1.RowSource = Range("A2:C" & Range("A" & Rows.Count).End(xlUp).Row).Address
End Sub
Private Sub CommandButton1_Click()
If Label4 > 0 Then
ListBox1.RowSource = ""
sat = Label4
Cells(sat, 1).Value = TextBox1.Value
Cells(sat, 2).Value = TextBox2.Value
Cells(sat, 3).Value = TextBox3.Value
ListBox1.ColumnCount = 3
ListBox1.RowSource = Range("A2:C" & Range("A" & Rows.Count).End(xlUp).Row).Address
MsgBox "işlem tamam"
End If
End Sub
Private Sub Listbox1_Click()
If ListBox1.ListIndex <> -1 Then
With ListBox1
TextBox1.Value = .List(.ListIndex, 0)
TextBox2.Value = .List(.ListIndex, 1)
TextBox3.Value = .List(.ListIndex, 2)
End With
Label4 = ListBox2.List(ListBox1.ListIndex)
End If
End Sub
Private Sub UserForm_Initialize()
ListBox1.ColumnCount = 3
ListBox1.RowSource = Range("A2:C" & Range("A" & Rows.Count).End(xlUp).Row).Address
For j = 2 To Cells(Rows.Count, 1).End(xlUp).Row
ListBox2.AddItem j
Next j
End Sub
Teşekkürler hocam, tam olarak istediğim buydu.Merhaba.
Bir fikir. İstenilen bu mu acaba?
TEXTBOXlara yazıldıkça.
Rich (BB code):Private Sub TextBox1_Change() Cells(ListBox1.ListIndex + 2, 1) = TextBox1 ListBox1.RowSource = Range("A2:C" & Range("A" & Rows.Count).End(xlUp).Row).Address End Sub Private Sub TextBox2_Change() Cells(ListBox1.ListIndex + 2, 2) = TextBox2 ListBox1.RowSource = Range("A2:C" & Range("A" & Rows.Count).End(xlUp).Row).Address End Sub Private Sub TextBox3_Change() Cells(ListBox1.ListIndex + 2, 3) = TextBox3 ListBox1.RowSource = Range("A2:C" & Range("A" & Rows.Count).End(xlUp).Row).Address End Sub
Size de teşekkür ederim Halit bey. Bu da işimi görüyor.Buyurun dosyanız ekte
userforma bir adet label4 ve listbox2 nesnesi ekleyiniz kodlar
Kod:Private Sub CommandButton1_Click() If Label4 > 0 Then ListBox1.RowSource = "" sat = Label4 Cells(sat, 1).Value = TextBox1.Value Cells(sat, 2).Value = TextBox2.Value Cells(sat, 3).Value = TextBox3.Value ListBox1.ColumnCount = 3 ListBox1.RowSource = Range("A2:C" & Range("A" & Rows.Count).End(xlUp).Row).Address MsgBox "işlem tamam" End If End Sub Private Sub Listbox1_Click() If ListBox1.ListIndex <> -1 Then With ListBox1 TextBox1.Value = .List(.ListIndex, 0) TextBox2.Value = .List(.ListIndex, 1) TextBox3.Value = .List(.ListIndex, 2) End With Label4 = ListBox2.List(ListBox1.ListIndex) End If End Sub Private Sub UserForm_Initialize() ListBox1.ColumnCount = 3 ListBox1.RowSource = Range("A2:C" & Range("A" & Rows.Count).End(xlUp).Row).Address For j = 2 To Cells(Rows.Count, 1).End(xlUp).Row ListBox2.AddItem j Next j End Sub
Teşekkürler.Düğme ile yapmak isterseniz; form üzerine 1 adet LABEL ekleyin
(ben Label4 dedim, bu nesnenin yazı rengini formun arkaplan rengiyle aynı yaparsanız veya başka bir nesnenin arkasına konumlandırısanız görünmez).
Kırmızı satırı, ListBox1_Click kod blokunda, End Sub satırından hemen öncesine ekleyin,
Düğmeye ait olarak da aşağıdaki kodu kullanın.
Rich (BB code):Label4.Caption = ListBox1.ListIndex Private Sub CommandButton1_Click() For txt = 1 To 3 Cells(Label4.Caption + 2, txt) = Controls("TextBox" & txt) Next ListBox1.RowSource = Range("A2:C" & Range("A" & Rows.Count).End(xlUp).Row).Address End Sub
OK.RowSource yöntemiyle textbox nesnelerinden hücrelere düzeltme yapamazsınız.
RowSource özelliğinin içini boşaltmak gerek
Tamam.Yanlış anlamayın ama; kullandığınız OK. kısaltması yerine Türkçe bir kelime kullanmanızınn daha yerinde olacağını söylemeliyim.
Kolay gelsin, önemli olan ihtiyacın görülmesi.
İyi çalışmalar dilerim.
.
Teşekkürler.6 ve 10 nolu mesajlarımda yazdığım kod ve mesajlarıma açıklık getirmek için sizin dosyanızdaki verileri 5. satırdan başlayarak userforma aldırdım diğer taraftan benim kullandığım listboxın Column özelliği ile ilgili userform ekledim irdeleyiniz.