Hey,
I'm currently working with a VBA code that filters data (as some of you may have seen from my last topic) and creates a new file from this filter. Once it saves the file, I was hoping there would be a way to save this as it's own Access Database. I am creating 15 different files and want to save each one as its own database so that it can be opened up as soon as the macro finishes.
Here's the location where I would like the code and the file name I would want (it'll be the same name as the Excel sheet it comes from.)
This is my VBA code to save as an excel document, what do I do from here to make it ALSO save as an access database?
In this scenario, I have defined SaveDirectory previously in my VBA code. How can I add to this code to save it as an Access Database (or import and save it) after saving it as it's own Excel workbook? I would want this to happen for each workbook I create. I assume it's a simple code I've just never worked with importing/exporting in VBA before. Thank you!
I'm currently working with a VBA code that filters data (as some of you may have seen from my last topic) and creates a new file from this filter. Once it saves the file, I was hoping there would be a way to save this as it's own Access Database. I am creating 15 different files and want to save each one as its own database so that it can be opened up as soon as the macro finishes.
Here's the location where I would like the code and the file name I would want (it'll be the same name as the Excel sheet it comes from.)
This is my VBA code to save as an excel document, what do I do from here to make it ALSO save as an access database?
Code:
'Save directory
Dim Filter1Directory As String
Filter1Directory = SaveDirectory & "Filter1" & Format(Date, "mmddyy") & ".xlsx"'Save the file
Application.DisplayAlerts = False
Filter1NewWB.SaveAs FileName:=FilterDirectory, FileFormat:=51
Application.DisplayAlerts = True
In this scenario, I have defined SaveDirectory previously in my VBA code. How can I add to this code to save it as an Access Database (or import and save it) after saving it as it's own Excel workbook? I would want this to happen for each workbook I create. I assume it's a simple code I've just never worked with importing/exporting in VBA before. Thank you!
Last edited: