Microsoft Office Excel ® Kod Kılavuzu

Microsoft Office Excel® Code Guide

10 Aralık 2004 Cuma

Sheet, ListBox, TextBox Connection



'UserForm1

Option Explicit
Dim i As Integer
Dim Adet, No As Double

Private Sub UserForm_Initialize()
On Error Resume Next
Me.Caption = "[PBİD®] Sheet, ListBox, TextBox Connection..."
Sheets("VeriTabanı").Select
Adet = Application.WorksheetFunction.Count(Range("A2:A100"))
With ListBox1
.ColumnCount = 4
.ColumnWidths = "30;48;72;72"
.RowSource = "VeriTabanı!A2:D" & Adet + 1
.ListIndex = 0
End With
End Sub
Private Sub ListBox1_Change()
On Error Resume Next
No = ListBox1.ListIndex
For i = 0 To (4 - 1)
Me("TextBox" & (i + 1)).Text = ListBox1.List(i, 0)
Next i
Sheets("VeriTabanı").Range(Cells(No + 2, 1), Cells((No + 2), 4)).Select
End Sub
Private Sub ListBox1_Click()
On Error Resume Next
No = ListBox1.ListIndex
TextBox1.Text = ListBox1.List(No, 0)
TextBox2.Text = ListBox1.List(No, 1)
TextBox3.Text = ListBox1.List(No, 2)
TextBox4.Text = ListBox1.List(No, 3)
Sheets("VeriTabanı").Range(Cells(No + 2, 1), Cells((No + 2), 4)).Select
End Sub

Hiç yorum yok:

Blog Arşivi

Bu gadget'ta bir hata oluştu

Bu Blogda Ara

Contributor

Contributor
Mustafa ULUSARAÇ İstanbul, TÜRKİYE
free counters
T. C. Central Bank Indicative Exchange Rates
Currency Exchange Rate Widget,Currency Converter Widget
Borsa İstanbul