arkadaşlar merhabalar, aşağıdaik kodlar ile userform üzerindeki listboxa verileri aldırıyorum, fakat bu verileri yazdır düğmesine bastığımda yazıcıdan çıktısını almak istiyorum. kullandığım kodlar
Private Sub UserForm_Initialize()
Dim STR As Long, STR1 As Long
STR1 = 0
ListBox1.ColumnWidths = "25;80;100;80;50;80;50"
ListBox1.ColumnHeads = False
ListBox1.BackColor = vbBlue
ListBox1.ForeColor = vbWhite
ListBox1.ColumnCount = 7
For STR = 2 To Cells(Rows.Count, "A").End(xlUp).Row
If CDate(Cells(STR, "F")) <= CDate(Date) Then
ListBox1.AddItem
ListBox1.List(STR1, 0) = Cells(STR, "A")
ListBox1.List(STR1, 1) = Cells(STR, "B")
ListBox1.List(STR1, 2) = Cells(STR, "C")
ListBox1.List(STR1, 3) = Format(Cells(STR, "D"), "dd.mm.yyyy")
ListBox1.List(STR1, 4) = Cells(STR, "E")
ListBox1.List(STR1, 5) = Format(Cells(STR, "F"), "dd.mm.yyyy")
ListBox1.List(STR1, 6) = CDate(Cells(STR, "F")) - CDate(Date)
STR1 = STR1 + 1
End If
Next
End Sub
userform üzerinde bir de YAZDIR diye düğme var, ona basınca bu listboxdaki verlieri yazıcıdan yazdırmak istiyorum. acaba mümkün mü?
Private Sub UserForm_Initialize()
Dim STR As Long, STR1 As Long
STR1 = 0
ListBox1.ColumnWidths = "25;80;100;80;50;80;50"
ListBox1.ColumnHeads = False
ListBox1.BackColor = vbBlue
ListBox1.ForeColor = vbWhite
ListBox1.ColumnCount = 7
For STR = 2 To Cells(Rows.Count, "A").End(xlUp).Row
If CDate(Cells(STR, "F")) <= CDate(Date) Then
ListBox1.AddItem
ListBox1.List(STR1, 0) = Cells(STR, "A")
ListBox1.List(STR1, 1) = Cells(STR, "B")
ListBox1.List(STR1, 2) = Cells(STR, "C")
ListBox1.List(STR1, 3) = Format(Cells(STR, "D"), "dd.mm.yyyy")
ListBox1.List(STR1, 4) = Cells(STR, "E")
ListBox1.List(STR1, 5) = Format(Cells(STR, "F"), "dd.mm.yyyy")
ListBox1.List(STR1, 6) = CDate(Cells(STR, "F")) - CDate(Date)
STR1 = STR1 + 1
End If
Next
End Sub
userform üzerinde bir de YAZDIR diye düğme var, ona basınca bu listboxdaki verlieri yazıcıdan yazdırmak istiyorum. acaba mümkün mü?
