T
terje.eriksen
Hi,
Im working on a excel sheet and my plan is as followed:
-by pressing commandbutton, it automatically prints the file to pdf,
to a specified location, and then I want a filename specified from a
number
on one of the cells.
My code now:
Private Sub commandbutton1_Click()
Call printthis
'
End Sub
Sub printthis()
Application.ActivePrinter = "Win2PDF på Ne00:"
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, _
ActivePrinter:="Win2PDF på Ne00:", Collate:=True,
PrToFilename:="c:\filename.pdf"
End Sub
Is there someting I could insert instead of "filename.pdf" to get the
name to be the same as the number in cell E2?
Im working on a excel sheet and my plan is as followed:
-by pressing commandbutton, it automatically prints the file to pdf,
to a specified location, and then I want a filename specified from a
number
on one of the cells.
My code now:
Private Sub commandbutton1_Click()
Call printthis
'
End Sub
Sub printthis()
Application.ActivePrinter = "Win2PDF på Ne00:"
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, _
ActivePrinter:="Win2PDF på Ne00:", Collate:=True,
PrToFilename:="c:\filename.pdf"
End Sub
Is there someting I could insert instead of "filename.pdf" to get the
name to be the same as the number in cell E2?