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.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
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)?
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,843
Members
449,051
Latest member
excelquestion515

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