Private Sub CommandButton1_Click()
Dim TDon(), TR(), Ldon As Long, LR As Long, C As Long
TDon = CLsC.PlgTablo.Value 'résultat de la plage suivi commande
ReDim TR(1 To WshBCVierge.[CorpsFacture].Rows.Count, 1 To 5)
'ReDim TLBx(1 To UBound(TLC), 1 To 5)
For LR = 1 To UBound(TLC)
Ldon = TLC(LR)
For C = 1 To 5: TR(LR, C) = TDon(Ldon, Choose(C, 8, 9, 10, 11, 12)): Next C, LR
WshBCVierge.[CorpsFacture].Value = TR
WshBCVierge.[RéfBC].Value = TDon(Ldon, 1)
WshBCVierge.[Fournisseur].Value = TDon(Ldon, 4)
WshBCVierge.[DateCommande].Value = TDon(Ldon, 2)
WshBCVierge.[Port].Value = TDon(Ldon, 6)
WshBCVierge.[Delailivraison].Value = TDon(Ldon, 5)
WshBCVierge.[AdresseFournisseur].Value = TVLF(1, 4)
WshBCVierge.[CP].Value = TVLF(1, 5)
WshBCVierge.[Ville].Value = TVLF(1, 6)
WshBCVierge.[ConditionPaiement].Value = TVLF(1, 19)
WshBCVierge.Activate 'afficher la feuille en fin de procédure
Application.ScreenUpdating = False
WshBCVierge.ExportAsFixedFormat xlTypePDF, "BC" & Range("I1") & Range("G7")
Selection.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"F:\Exportation\BC\ BC " & " " & Range("I3") & " " & Range("G7") & ".pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
End Sub
'Selection.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
'"F:\Exportation\BC\ BC " & " " & Range("I3") & " " & Range("G7") & ".pdf", Quality:=xlQualityStandard, _
'IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
Private Sub CommandButton1_Click()
Dim TDon(), TR(), Ldon As Long, LR As Long, C As Long
TDon = CLsC.PlgTablo.Value 'résultat de la plage suivi commande
ReDim TR(1 To WshBCVierge.[CorpsFacture].Rows.Count, 1 To 5)
'ReDim TLBx(1 To UBound(TLC), 1 To 5)
For LR = 1 To UBound(TLC)
Ldon = TLC(LR)
For C = 1 To 5: TR(LR, C) = TDon(Ldon, Choose(C, 8, 9, 10, 11, 12)): Next C, LR
WshBCVierge.[CorpsFacture].Value = TR
WshBCVierge.[RéfBC].Value = TDon(Ldon, 1)
WshBCVierge.[Fournisseur].Value = TDon(Ldon, 4)
WshBCVierge.[DateCommande].Value = TDon(Ldon, 2)
WshBCVierge.[Port].Value = TDon(Ldon, 6)
WshBCVierge.[Delailivraison].Value = TDon(Ldon, 5)
WshBCVierge.[AdresseFournisseur].Value = TVLF(1, 4)
WshBCVierge.[CP].Value = TVLF(1, 5)
WshBCVierge.[Ville].Value = TVLF(1, 6)
WshBCVierge.[ConditionPaiement].Value = TVLF(1, 19)
WshBCVierge.Activate 'afficher la feuille en fin de procédure
'WshBCVierge.PrintPreview
Application.ScreenUpdating = False
WshBCVierge.ExportAsFixedFormat xlTypePDF, "BC" & " " & Range("I1") & " " & Range("G7"), xlQualityStandard, True, True, , "F:\Exportation\BC\", True, xlTypePDF
'Selection.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
'"F:\Exportation\BC\ BC " & Range("I3") & Range("G7") & ".pdf", Quality:=xlQualityStandard, _
'IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
End Sub
Sub Saveas()
ActiveWorkbook.Saveas 'sauvegarde de la base à son lieu actuel d'utilisation
ActiveWorkbook.Saveas Filename:="F:\Exportation\ARCHIVES\" & "GDSTK" & Range("A2").Value 'sauvegarde pour archiver la base
End Sub
Sub Saveas()
ThisWorkbook.Save
ThisWorkbook.Saveas "F:\Exportation\ARCHIVES\GDSTK" & " " & Format(Date, "yyyymmdd") & ".xlsm"
End Sub
Sub Saveas()
ThisWorkbook.Save
ThisWorkbook.SaveCopyAs "F:\Exportation\ARCHIVES\GDSTK" & " " & Format(Date, "yyyymmdd") & ".xlsm"
End Sub