Hello all bright minded people, please allow me to ask a question:
I have a complicated excel project that uses Power Query to read data from different directories. To indicate the source I have a drop down menu (with all the sources) and a FilePath named in name manager. The project outputs results in the active sheet based on different vba routines.
Problem: I need to copy the results to a different file named as the current day that will reside in an "output" folder in the location of each source; I am trying to adapt the script below for doing that but have some syntax problems.
In other words, if I have 4 source directories A, B, C, D and when I select to import from A, I will need to save the file in A:\output; A, B, C, D contain the source files, locations that are variables (defined in FilePath)
What I am using below works but I need to somehow introduce Filepath\output and I don't know how. Your help is much appreciated.
Sub Storing()
Dim sFileName$
Application.ScreenUpdating = False
sFileName = ThisWorkbook.Path & "\" & Format(Date, "mm_dd_yyyy") & ".xlsx"
ActiveSheet.Copy
ActiveWorkbook.SaveAs sFileName
ActiveWorkbook.Close savechanges:=False
MsgBox "The Sheet name is saved as " & sFileName & "!"
Application.ScreenUpdating = True
End Sub
I have a complicated excel project that uses Power Query to read data from different directories. To indicate the source I have a drop down menu (with all the sources) and a FilePath named in name manager. The project outputs results in the active sheet based on different vba routines.
Problem: I need to copy the results to a different file named as the current day that will reside in an "output" folder in the location of each source; I am trying to adapt the script below for doing that but have some syntax problems.
In other words, if I have 4 source directories A, B, C, D and when I select to import from A, I will need to save the file in A:\output; A, B, C, D contain the source files, locations that are variables (defined in FilePath)
What I am using below works but I need to somehow introduce Filepath\output and I don't know how. Your help is much appreciated.
Sub Storing()
Dim sFileName$
Application.ScreenUpdating = False
sFileName = ThisWorkbook.Path & "\" & Format(Date, "mm_dd_yyyy") & ".xlsx"
ActiveSheet.Copy
ActiveWorkbook.SaveAs sFileName
ActiveWorkbook.Close savechanges:=False
MsgBox "The Sheet name is saved as " & sFileName & "!"
Application.ScreenUpdating = True
End Sub