I am working on writing a macro that will compile a file and save it to a specified location. The issue I am running into is the format of the file path. Currently I have the macro reading the file path from a formula hidden in a worksheet. The user updates month and year which through a CONCATENATE formula, will give the file path. How can I setup my code to take me to the below folder without referencing my formula? Also, this file will be run in the following month (Dec 2016 file will be run early in January 2017). Also, I need the file name to save with the date and year. That format can be Dec 2016, 12.2016, or December 2016.
File Path: HFM Monthly Closing\2016\12 December 2016\08 Miscellaneous BU Analysis\2016
Dim FName As String
Dim FPath As String
FPath = "\\J:Finance\CONTROLLERSHIP\BUFin&Consolidation\HFM Monthly Closing\" & Sheets("Worksheet").Range("D6")
FName = Sheets("Worksheet").Range("D7").Text
Workbooks.SaveAs Filename:=FPath & FName & ".xlsm"
Thanks!
Bookmarks