phyxius117
New Member
- Joined
- May 14, 2024
- Messages
- 6
- Office Version
- Prefer Not To Say
- Platform
- Windows
Hello all,
I have figured most of it out myself and after looking around on the internet I still can't figure out a solution to make it value only when saving to a new workbook. I have tested the current code and it works but the new workbooks still have my original formulas in them which is mostly referencing another sheet in the active workbook. I want this new workbook saved as value only.
Here is the current code:
Sub Export()
Dim DCname As String
DCname = ActiveWorkbook.Sheets("Reference").Range("R2").Value
Dim FiscalYear As String
FiscalYear = ActiveWorkbook.Sheets("Reference").Range("R8").Value
Dim Period As String
Period = ActiveWorkbook.Sheets("Reference").Range("R11").Value
Dim FileName As String
FileName = DCname & "_SQL Data_FY" & FiscalYear & "_P" & Period
Worksheets(Array("Route Totals", "Stops")).Copy
ActiveWorkbook.SaveAs ThisWorkbook.Path & "\" & FileName, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
End Sub
Thanks for any help I could get!
I have figured most of it out myself and after looking around on the internet I still can't figure out a solution to make it value only when saving to a new workbook. I have tested the current code and it works but the new workbooks still have my original formulas in them which is mostly referencing another sheet in the active workbook. I want this new workbook saved as value only.
Here is the current code:
Sub Export()
Dim DCname As String
DCname = ActiveWorkbook.Sheets("Reference").Range("R2").Value
Dim FiscalYear As String
FiscalYear = ActiveWorkbook.Sheets("Reference").Range("R8").Value
Dim Period As String
Period = ActiveWorkbook.Sheets("Reference").Range("R11").Value
Dim FileName As String
FileName = DCname & "_SQL Data_FY" & FiscalYear & "_P" & Period
Worksheets(Array("Route Totals", "Stops")).Copy
ActiveWorkbook.SaveAs ThisWorkbook.Path & "\" & FileName, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
End Sub
Thanks for any help I could get!