luis_marques
Member
Hi Folks,
I use the following macro, which is actionable using a button in the sheet 1, to print a hidden sheet 2. The report is printed in PDF extension and the file must be opened.
The problem is: when PDF file is generated the print area between the pages of the report in the sheet 2 is variable in different computers.
I need to generate each page printed with 57 rows in the PDF file. Is possible to add such routine in this macro below?
Thanks in advance.
I use the following macro, which is actionable using a button in the sheet 1, to print a hidden sheet 2. The report is printed in PDF extension and the file must be opened.
The problem is: when PDF file is generated the print area between the pages of the report in the sheet 2 is variable in different computers.
I need to generate each page printed with 57 rows in the PDF file. Is possible to add such routine in this macro below?
Thanks in advance.
Code:
Sub GerarPDF2()
Dim SVInput As String
Dim Nome As String
Worksheets("Sheet2").Visible = True
Sheets("Sheet2").Select
Nome = InputBox("Digite o nome para o relatório", "Gerar Relatório PDF")
On Error Resume Next
SVInput = ThisWorkbook.Path & Application.PathSeparator & Nome & ".pdf"
With Worksheets("Sheet2")
.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=SVInput, _
OpenAfterPublish:=True
End With
Sheets("Sheet2").Visible = False
End Sub
Last edited by a moderator: