Save cell reference to pdf file name & to onedrive?

MarkReddell

Board Regular
Joined
Sep 1, 2011
Messages
210
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
Hello Exceler's,

I need some help with this vba code. Any help will greatly appreciated!!!

Everything works but the pdf code.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.ExecuteExcel4Macro "show.toolbar(""Ribbon"",True)"
Application.DisplayFormulaBar = True
ActiveWindow.DisplayWorkbookTabs = True
Sheets("Solve For Supplements").Select
Call Sort1
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:=Sheets("Solve For Supplements").Range("Y1") & Sheets("Solve For Supplements").Range("AB2").Value
ActiveWorkbook.SaveAs FileName:=Sheets("Solve For Supplements").Range("Y1") & Sheets("Solve For Supplements").Range("Y2").Value & ".xlsm"
MsgBox ("This File has Been Saved on our OneDrive in the Spreadsheet Folder Under the Current Report Date, Rep Name, and Customer's Name! If You Have any Questions or Concerns About this File: Call Mark Reddell at: !!!")
End Sub
 
Last edited by a moderator:

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,213,536
Messages
6,114,207
Members
448,554
Latest member
Gleisner2

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