Enregistrer excel en pdf
Résolu
kamikase
Messages postés
2
Statut
Membre
-
gbinforme Messages postés 15478 Statut Contributeur -
gbinforme Messages postés 15478 Statut Contributeur -
bonjour a tous voilà j aimerais savoir ce que je dois ajouter a la macro pour pouvoir enregistrer la facture en pdf mais uniquement la facture et pas tous le classeur merci de me donner un peu de votre lumière
Sub Client_suivant()
'
' Client_suivant Macro
'
'
Dim rep As String
Dim enregist As String
Dim nom As String
Dim prenom As String
Dim nopre
Dim nomenreg As String
Dim motpasse As Integer
debut:
On Error GoTo terreur
rep = InputBox("attention, la facture va être imprimé; voulez-vous continuer? (o/n)")
If LCase(rep) = "o" Then
ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,2,,,TRUE,,FALSE)"
End If
retourmp:
enregist = InputBox("voulez-vous enregistrer la facture? (o/n)")
If LCase(enregist) = "o" Then
nomenreg = InputBox("Entrez le nom de la facture à enregistrer") & [B11].Value & "_" & [G45].Value
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, Filename:="C:\Users\Utilisateur\Documents\FACTURE\ " & nomenreg & "_" & Format(Date, "dd-mm-yyyy") & "_" & Format(Time, "hh-mm") & ".pdf"
Else
motpasse = InputBox("entrez le mot de passe")
If motpasse = 1234 Then
MsgBox "ok, le mot de passe est bon et la facture ne sera pas enregistrée"
Else
MsgBox "Désolé, le mot de passe n'est pas bon", vbCritical
GoTo retourmp
End If
End If
Range("B10").Select
Selection.ClearContents
Range("A17:B39").Select
Selection.ClearContents
Range("F44").Select
Selection.ClearContents
Range("M8").Select
Selection.Copy
Range("D7").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("B10").Select
Exit Sub
terreur:
MsgBox "Attention, une erreur a été détectée, veuillez tout recommencer", vbExclamation
GoTo debut
End Sub
voila merci de votre aide
Sub Client_suivant()
'
' Client_suivant Macro
'
'
Dim rep As String
Dim enregist As String
Dim nom As String
Dim prenom As String
Dim nopre
Dim nomenreg As String
Dim motpasse As Integer
debut:
On Error GoTo terreur
rep = InputBox("attention, la facture va être imprimé; voulez-vous continuer? (o/n)")
If LCase(rep) = "o" Then
ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,2,,,TRUE,,FALSE)"
End If
retourmp:
enregist = InputBox("voulez-vous enregistrer la facture? (o/n)")
If LCase(enregist) = "o" Then
nomenreg = InputBox("Entrez le nom de la facture à enregistrer") & [B11].Value & "_" & [G45].Value
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, Filename:="C:\Users\Utilisateur\Documents\FACTURE\ " & nomenreg & "_" & Format(Date, "dd-mm-yyyy") & "_" & Format(Time, "hh-mm") & ".pdf"
Else
motpasse = InputBox("entrez le mot de passe")
If motpasse = 1234 Then
MsgBox "ok, le mot de passe est bon et la facture ne sera pas enregistrée"
Else
MsgBox "Désolé, le mot de passe n'est pas bon", vbCritical
GoTo retourmp
End If
End If
Range("B10").Select
Selection.ClearContents
Range("A17:B39").Select
Selection.ClearContents
Range("F44").Select
Selection.ClearContents
Range("M8").Select
Selection.Copy
Range("D7").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("B10").Select
Exit Sub
terreur:
MsgBox "Attention, une erreur a été détectée, veuillez tout recommencer", vbExclamation
GoTo debut
End Sub
voila merci de votre aide
A voir également:
- Enregistrer excel en pdf
- Lire le coran en français pdf - Télécharger - Histoire & Religion
- Audacity enregistrer son pc - Guide
- Liste déroulante excel - Guide
- Enregistrer un fichier excel en pdf sur une seule page - Guide
- Word et excel gratuit - Guide