I have been trying to copy a workbook to a new folder with the name and extension specified but I keep saving the current workbook with a new name to the folder I need, I have a code before that updates a page with new information from different departments so the excels need to be named something different
I have tried changing the code multiple times and googled different methods but can't seem to get what I want.
Any help we be great
- Sub export111()
- 'Dim n As Integer
- 'Dim filename As String
- 'Dim current As Range, newws As Range
- 'Set NewBook = Workbooks.Add
- Application.DisplayAlerts = False
- Application.ScreenUpdating = False
- FPath = "\\global.\"
- ThisWorkbook.Worksheets("Dates").Range("H1").Value = Format(Now, "mm/dd/yyyy")
- FName = ThisWorkbook.Worksheets("BCS").Range("G4").Value & "-" & "Period" & "-" & ThisWorkbook.Worksheets("Dates").Range("I1").Value
- ThisWorkbook.SaveCopyAs Path & FName, FileFormat:=51
- End Sub