[RESOLVIDO] Gerar arquivo pdf somente da folha 1 (um)
Enviado: Qui Set 13, 2018 9:31 pm
Ola pessoal!
A Macro abaixo gera arquivo pdf das folhas 1 e 2 ao clicar em SIM, preciso de uma ajuda pra gerar apenas da folha 1 ao clicar em NÃO.
Alguém pode ajudar?
Segue a Plan anexo...
resposta = MsgBox("Gerar pdf das folhas 1 e 2", vbQuestion + vbYesNo, "Pergunta")
If resposta = vbYes Then
'***GERAR ARQUIVO PDF
Dim data As String
Worksheets("Plan1").Select
'Range("A1:Q53").Select 'essa função não tem efeito
data = VBA.Format(VBA.Date, "yyyymmdd") & "_" & Format(Time, "hhmmss")
'Local C:\PDF\
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\PDF\" & "\Orçamento" & "_" & ActiveSheet.Range("B9").Value & "_" & data & ".pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
ElseIf resposta = vbNo Then
'Gera arquivo somente da folha 1
End If
A Macro abaixo gera arquivo pdf das folhas 1 e 2 ao clicar em SIM, preciso de uma ajuda pra gerar apenas da folha 1 ao clicar em NÃO.
Alguém pode ajudar?
Segue a Plan anexo...
resposta = MsgBox("Gerar pdf das folhas 1 e 2", vbQuestion + vbYesNo, "Pergunta")
If resposta = vbYes Then
'***GERAR ARQUIVO PDF
Dim data As String
Worksheets("Plan1").Select
'Range("A1:Q53").Select 'essa função não tem efeito
data = VBA.Format(VBA.Date, "yyyymmdd") & "_" & Format(Time, "hhmmss")
'Local C:\PDF\
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\PDF\" & "\Orçamento" & "_" & ActiveSheet.Range("B9").Value & "_" & data & ".pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
ElseIf resposta = vbNo Then
'Gera arquivo somente da folha 1
End If