VBA excel save as PDF in specific location

Eddy08

New Member
Joined
Jan 21, 2021
Messages
1
Office Version
  1. 2013
Platform
  1. Windows
Im really getting frustrated and on this for a few days (not an excel expert at all)

My question is:

I have the last part of my VBA correct, which removes written data in specific cells, adds a number in a specific cell (invoice number), changes the date to the correct
date and prints 1 copy.

VBA Code:
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False

Range("C3:D5").ClearContents
    Range("B1").Select
    Range("F1").Value = Date
    Range("B1").Value = Range("B1").Value + 1

the first part however, wont work. Is it possible for my excel file to be saved in multiple locations with different extensions.
I want 1 file to be exported as PDF in a networkfolder in a subfolder called PDF
and I want 1 file to be save as excel file in the same networkfolder but then in a subfolder called EXCEL.
 

Some videos you may like

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

John_w

MrExcel MVP
Joined
Oct 15, 2007
Messages
6,712
Welcome to MrExcel forums.

For the PDF, record a macro with you saving the whole workbook/active sheet/selected sheets (it's not really clear what you want) as a PDF in the PDF subfolder. The generated code can then be incorporated into the overall macro.

For the Excel file, do you want save it as a macro-enabled workbook (.xlsm) or as a worksheet (.xlsx)?
 

Watch MrExcel Video

Forum statistics

Threads
1,127,395
Messages
5,624,467
Members
416,029
Latest member
CSM1

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
Top