Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tópicos relacionados a códigos VBA, gravação de macros, etc.
#8499
Boa tarde!
Como determinar a impressão em pdf de apenas uma planilha neste código.
Ela imprime todas, mas me bastaria uma.
Como posso determinar que ela faça somente em uma planilha, ex: "P01"
Obs: não posso apagar a "D1" das outras planilhas.
Sei que o código está bagunçado, mas agradeço que puder me ajudar

Grato!




'CRIAR PDF <<<<<<
'Create a PDF and mail of every sheet with a mail address in cell A1 (Sheet5 and sheet6)
'You see that the code create two mails, one with sheet5 and one with sheet6 and send it
'to the address in A1 of that sheet.

Sub Mail_Every_Worksheet_With_Address_In_A1_PDF2()
'Working only in 2007 and up
Dim sh As Worksheet
Dim TempFilePath As String
Dim TempFileName As String
Dim FileName As String
Dim vCelula As Range

'Temporary path to save the PDF files
'You can also use another folder like
'TempFilePath = "C:\Users\Ron\MyFolder\"
'or TempFilePath = Environ$("temp") & "\"
TempFilePath = "D:\PDF\"

'Loop through every worksheet
For Each Sheets("P01") In ThisWorkbook.Worksheets
FileName = ""

'Test A1 for a mail address
'If sh.Range("M8").Value Like "?*@?*.?*" Then
'Test A1 for a mail address (SUBSTITUIR PELO TOTAL)
If Sheets("A").Range("D1").Value Like "?*" Then

'If there is a mail address in A1 create the file name and the PDF
TempFileName = TempFilePath _
& "CVLO" _
& " " _
& Sheets("A").Range("D1").Value _
& " " _
& Format(Sheets("A").Range("Q2").Value, "00000") _
& Format(Now, " dd-mm-yyyy") _
& ".pdf"

FileName = RDB_Create_PDF(Source:=sh, _
FixedFilePathName:=TempFileName, _
OverwriteIfFileExist:=True, _
OpenPDFAfterPublish:=False)



For Each vCelula In Sheets("X").Range("Q2").Cells
vCelula.Value = vCelula.Value + 1
Next
ActiveWorkbook.Save

End If

' Call LimparCelulas

Next sh
End Sub
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord