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.
  • Avatar do usuário
#7050
Como salvar .pdf com valor da célula personalizada "00045"
A célula O2 está personalizada em "00000", mas salva o arquivo "45.pdf" ao invés de "000045.pdf"
OBS: o valor de "O2" nunca será o mesmo.

Grato pela ajuda


Sub PDF2()

Dim sh As Worksheet
Dim TempFilePath As String
Dim TempFileName As String
Dim FileName As String
Dim vCelula As Range

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


TempFilePath = "D:\PDF\"

'Loop through every worksheet
For Each sh In ThisWorkbook.Worksheets
FileName = ""

'Test A1 for a mail address
If sh.Range("M8").Value Like "?*@?*.?*" Then

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

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



End If

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