Darbyshire
New Member
- Joined
- Feb 3, 2021
- Messages
- 3
- Office Version
- 365
- Platform
- Windows
Hello
I have created the following VBA module, which saves and dynamically names a new workbook which is fine, but I really need to save the active sheet on its own as values and formats only, so it pulls through the data but no formulas but retains all page formatting in the new workbook as well.
Still learning VBA as I go so be glad of any suggestions/help, please. Many Thanks
Sub saveValuesFormat()
'
' saveValuesFormat Macro
'
'
Dim strName As String
Dim companyFilepath As String
strName = Range("AJ1")
companyFilepath = "C:\Users\**************\*************\***************\***************\" & strName
ThisWorkbook.Sheets("ANALYSIS REPORT").Activate
ActiveSheet.Copy
Set tempWB = ActiveWorkbook
With tempWB
.SaveAs Filename:=companyFilepath, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
.Close
End With
End Sub
I have created the following VBA module, which saves and dynamically names a new workbook which is fine, but I really need to save the active sheet on its own as values and formats only, so it pulls through the data but no formulas but retains all page formatting in the new workbook as well.
Still learning VBA as I go so be glad of any suggestions/help, please. Many Thanks
Sub saveValuesFormat()
'
' saveValuesFormat Macro
'
'
Dim strName As String
Dim companyFilepath As String
strName = Range("AJ1")
companyFilepath = "C:\Users\**************\*************\***************\***************\" & strName
ThisWorkbook.Sheets("ANALYSIS REPORT").Activate
ActiveSheet.Copy
Set tempWB = ActiveWorkbook
With tempWB
.SaveAs Filename:=companyFilepath, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
.Close
End With
End Sub