- Katılım
- 2 Mart 2005
- Mesajlar
- 2,960
- Excel Vers. ve Dili
-
ev: Ofis 2007- Win Xp
iş: Ofis 2010- Win Vista
Kod:
Private Sub Lvw_AdSoyad_guncelle()
Dim wsPers As Worksheet
Dim i%
Dim x
Set wsPers = ThisWorkbook.Sheets("PRS")
With Lvw_AdSoyad
.ListItems.Clear
For i = 2 To wsPers.Cells(65536, 1).End(xlUp).Row - 1
If wsPers.Cells(2, 1) <> "" Then
.ListItems.Add , , wsPers.Cells(i, 1)
With .ListItems(.ListItems.Count)
.SubItems(1) = wsPers.Cells(i, 2)
.SubItems(2) = wsPers.Cells(i, 3)
.SubItems(3) = wsPers.Cells(i, 4)
End With
End If
Next i
End With
Set wsPers = Nothing
End Sub
Kod:
Private Sub CommandButton1_Click() '##'
1 Dim col As New Collection '##'
'*\ Lvw_AdSoyadde Seçili olanları koleksiyona al ve sayısını tesbit et... '##'
2 With Lvw_AdSoyad '##'
3 For i = 1 To .ListItems.Count '##'
4 If .ListItems(i).Checked Then
[B][COLOR=green] col.Add .ListItems(i).Text[/COLOR][/B] '##'
[COLOR=red][B] 'col.Add??? = .SubItems(i, 1).Text 'çek işaretli satırın 1.alt öğesi '##'[/B][/COLOR]
[B][COLOR=red] 'col.Add??? = .SubItems(i, 2).Text 'çek işaretli satırın 2.alt öğesi '##'[/COLOR][/B]
[COLOR=red][B] 'col.Add??? = .SubItems(i, 2).Text 'çek işaretli satırın 3.alt öğesi[/B][/COLOR]
End If
5 Next i '##'
''*\ ... Eğer işaretli olan satır yoksa prosodürden çık, ... '##'
6 If col.Count = 0 Then '##'
7 MsgBox "Seçili veri bulunamadı" '##'
8 Else '##'
9 Soru = CmbYazici.Value & " Yazıcısından " & col.Count & " adet çalışma sayfasından " & _
TextBox1.Value & " -er/-ar adet Yazdırmak İstiyor musunuz?" '##'
10 If MsgBox(Soru, vbYesNo) = vbYes Then '##'
''*\ ... Listbox1 de seçili sayfaları CmbYazici deki yazıcıdan textbox1 deki kadar yazdır. '##'
11 For i = 1 To col.Count '##'
MsgBox col.Item(i) 'koleksiyona alınan ilk veri (seçili asıl öğe)
[COLOR=red][B]' MsgBox col.Item???1 'koleksiyona alınan i. veri (seçili 1.alt öğe)[/B][/COLOR]
[COLOR=red][B]' MsgBox col.Item???2 'koleksiyona alınan i. veri (seçili 2.alt öğe)[/B][/COLOR]
[COLOR=red][B]' MsgBox col.Item???3 'koleksiyona alınan i. veri (seçili 3.alt öğe)[/B][/COLOR]
'12 Sheets(col.Item(i)).PrintOut _
' Copies:=TextBox1.Value, ActivePrinter:=CmbYazici.Value '##'
13 Next i '##'
14 End If '##'
15 End If '##'
16 End With 'Lvw_AdSoyad '##'
17 Set col = Nothing '##'
'18 Unload Me '##'
End Sub