Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50061

Print frim listbox with user defined options

$
0
0
I have the following code that prints out a user selected worksheet very nicely

Code:

Private Sub CommandButton1_Click()

Dim L As Long
For L = 0 To Me.ListBox1.ListCount - 1
If Me.ListBox1.Selected(L) = True Then

ThisWorkbook.Sheets(Me.ListBox1.List(L)).Printout Copies:=1, Collate:=True
End If
Next
End Sub

How do I amend the code so that it prints out
1- Selection (being A1:W100)
2 - A3 paper
3- Landscape
4- to fit one page

I have tried recording the macro but i cant see where to put the code?

thanks!

Viewing all articles
Browse latest Browse all 50061

Trending Articles