jalrs
Active Member
- Joined
- Apr 6, 2022
- Messages
- 300
- Office Version
- 365
- Platform
- Windows
Hello guys, good morning
I'm trying to assign my macros to a sheet i created as a "Control Panel" on my masterWB.
i have this vba code on a template workbook, in order to copy the template with filtered information, without losing the template aftwerwards
i think the problem relies on ActiveWorkbook.SaveAs since when i try to assign the macro to the masterWB, it makes a copy of masterWB instead of the template one.
additionaly, i'd like to know how can i set current date as the filename, like "ST_atéDDMMYYYY_Apoio SP". Not sure if you find this question related to crossposting, but since i'm making a new thread with another question, felt like emphasizing it since I had no solution (here it is anyway Macro that saves a copy of a workbook into a specific location with a specific name)
any help is appreciated,
Thanks all!
I'm trying to assign my macros to a sheet i created as a "Control Panel" on my masterWB.
i have this vba code on a template workbook, in order to copy the template with filtered information, without losing the template aftwerwards
VBA Code:
Sub primeiroTrimestre()
Dim path As String
Dim filename As String
path = "C:\Users\joafrodrigue\Desktop\prototipo\Difusao\"
filename = "ST_até31032022_Apoio SP"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs filename:=path & filename & ".xlsx", FileFormat:=xlOpenXMLWorkbook
Application.DisplayAlerts = True
End Sub
i think the problem relies on ActiveWorkbook.SaveAs since when i try to assign the macro to the masterWB, it makes a copy of masterWB instead of the template one.
additionaly, i'd like to know how can i set current date as the filename, like "ST_atéDDMMYYYY_Apoio SP". Not sure if you find this question related to crossposting, but since i'm making a new thread with another question, felt like emphasizing it since I had no solution (here it is anyway Macro that saves a copy of a workbook into a specific location with a specific name)
any help is appreciated,
Thanks all!