is it possible save file as pdf based on date of PC and specific text without any range ?

KalilMe

Active Member
Joined
Mar 5, 2021
Messages
343
Office Version
  1. 2016
Platform
  1. Windows
hello
I'm asking about save my file as pdf based on date of PC and specific text without depending on ranges
for instance the date today is 03/04/2021 and the text INVENTORY OF CARS DATE
then should save the file name is INVENTORY OF CARS DATE 03/04/2021
note : my range in the sheet from A2: H is dynamically sometimes increases I can't specify where is finished in col H
thanks for any suggestion
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
"INVENTORY OF CARS DATE 03/04/2021" is an illegal file name. "/" is not allowed.

You don't save a file as a PDF, you save worksheets. The example below saves the active worksheet. It is possible to select more than one worksheet for export; it works the same way as if you want to print more than one worksheet, but it sounds like you only want to export one worksheet.

If the number of rows varies, this will print whatever UsedRange is for the sheet.

VBA Code:
   ActiveSheet.ExportAsFixedFormat _
      Type:=xlTypePDF, _
      Filename:="INVENTORY OF CARS DATE " & Format(Date, "dd-mm-yyyy"), _
      Quality:=xlQualityStandard, _
      IncludeDocProperties:=True, _
      IgnorePrintAreas:=False, _
      OpenAfterPublish:=False
 
Upvote 0
Hi
but where is file after saved I don't find anything where run the code
 
Upvote 0

Forum statistics

Threads
1,214,981
Messages
6,122,565
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top