Forum Discussion
jaredcott6
May 05, 2023Copper Contributor
VBA issues with automation
Hello, I am currently trying to make a "template" to use for work. I have the data collection and averaging already done I just need a quicker way to get the data into my workbook. Currently I am usi...
NikolinoDE
May 08, 2023Gold Contributor
You can try to add the following code to your existing script to achieve this:
Just make sure to place the new code after the End With statement in your existing script.
' Save the file with a dialog box
Dim NewFileName As Variant
NewFileName = Application.GetSaveAsFilename(InitialFileName:=FileName, _
FileFilter:="Excel Files (*.xlsx), *.xlsx")
If NewFileName <> False Then
ActiveWorkbook.SaveAs Filename:=NewFileName
End If
' Reopen the new report
Workbooks.Open NewFileName
I hope this helps!
I know I don't know anything (Socrates)