hi all
when i print my userform listbox the values of 1 column change to a different value
can someone tell me what i did wrong ?
screenshot of what i want to print
http://prntscr.com/keph0g
code of printing
screenshot of print outcome
http://prntscr.com/kepi7b
as you can see the list "Ton co²" is different values on listbox it give me the right value 1,xx but on printpage it gaves me value 11.xx
when i print my userform listbox the values of 1 column change to a different value
can someone tell me what i did wrong ?
screenshot of what i want to print
http://prntscr.com/keph0g
code of printing
Code:
Private Sub OUprint1()
Me.Hide
Dim rng As Range, wks As Worksheet, ListData()
' define sheet name for the list output
Set wks = ThisWorkbook.Worksheets("OUprint")
' define range start for the list output
Set rng = wks.Range("A7")
If OU.ListCount = 0 Then
MsgBox "There is nothing in the list to print!"
Exit Sub
End If
ReDim ListData(OU.ListCount - 1, OU.ColumnCount - 1)
ListData() = OU.List()
wks.Cells.Clear
wks.Range("A1") = Klant.Caption
wks.Range("A2") = Adres.Caption
wks.Range("A3") = Postcode.Caption
wks.Range("A4") = Plaats.Caption
wks.Range("A6") = "Merk"
wks.Range("B6") = "Type"
wks.Range("C6") = "Serienr"
wks.Range("D6") = "Bouwjaar"
wks.Range("E6") = "Freon"
wks.Range("F6") = "KG"
wks.Range("G6") = "Ton Co2"
wks.Range("H6") = "Installatienr"
wks.Range("I6") = "Adres"
wks.Range("J6") = "Status"
wks.Range(rng, rng.Offset(UBound(ListData), 9)).Value = ListData()
Application.ScreenUpdating = False
wks.Visible = xlSheetVisible
wks.PageSetup.Orientation = xlLandscape
wks.Cells.HorizontalAlignment = -4131
wks.PrintPreview
wks.Visible = xlSheetVisible
Application.ScreenUpdating = True
wks.Cells.Clear
Application.Visible = False
Me.Show
End Sub
screenshot of print outcome
http://prntscr.com/kepi7b
as you can see the list "Ton co²" is different values on listbox it give me the right value 1,xx but on printpage it gaves me value 11.xx
Last edited: