sn zipir mantık olarak ikinci kısmı manuel yapacaksınız sanırım.
ilk kısıma gelince, istediğnizi doğru anlamışsam; döngü kullanmanız gerek.
örnek kodları takip ederek tamamlayın. bir kaç alan attırdım ben.
Private Sub Komut18_Click()
Dim exceldosyasi As Object
Dim Klasor As String, strPersonel As String
Set exceldosyasi = CreateObject("Excel.Application")
Klasor = CurrentProject.Path & "\BANKA_LISTESI.xls"
Set Con1 = Application.CurrentProject.Connection
Set rst1 = CreateObject("ADODB.Recordset")
rst1.CursorLocation = adUseClient
currentCell = 13
With exceldosyasi
.Visible = True
.Workbooks.Open Klasor
.UserControl = True
.Range("A13:I1084").Select
.Application.CutCopyMode = False
.Selection.ClearContents
Sql = "select * from Q_ODEME_DETAY"
rst1.Open SQL, Con1, adOpenStatic, adLockBatchOptimistic
Do While Not rst1.EOF
.Range("B8").Value = Me.ODEME_KODU
.Range("B7").Value = Me.Metin32
.Range("B6").Value = Me.PARA_CINSI
.Range("B3").Value = Me.HESAP
.Range("B9").Value = Me.ACIKLAMA
intPersonel = rst1.Fields("ADI_SOYADI"): strPersonel =
Dlookup ("ADI_SOYADI", "T_BILGILER", "kimlik = " & intPersonel & "")
.Cells(currentCell, 1) = strPersonel
.Cells(currentCell, 2) = rst1.Fields("TC_NU")
'.Cells(currentCell, 5) = 12 ' örnek olarak koydum. veri doğrulamasından geçtiği için veri kontrolü burda yapılmalıdır.
.Cells(currentCell, 6) = rst1.Fields("IBAN_NU")
currentCell = currentCell + 1
rst1.MoveNext
Loop
End With
End Sub
Hayatta listbox kullanmam..