Change file name in "TransferSpreadsheet" macro ac

dmagnus

Board Regular
Joined
Dec 16, 2005
Messages
66
I created an Access macro to simply export a table to excel. Each month I want to export the same exact table to excel, except the folder needs to change (based on the current month's name).

For example: when the file is transferred to excel, the folder location is say N\Users\Reports\May Reports and the name of the file is "report_data". The name of the report can stay the same each month, but in June I want it to be transferred to the N\Users\Reports\June Reports folder.

Is there a way to create a prompt in which I enter the month name/abbreviatino and it puts that name into the folder's address automatically? Does that make sense?

Thanks in advance for any help.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
I don't know of any way to do what you are asking within a macro, unless you do a lot of condition statements checking to see what month it is, and then using that month in the prewritten (by you) TransferSpreadsheet action.
The best way to do this would be to do it in VBA.
HTH
 
Upvote 0
Dan

Why not convert the macro to 'proper' VBA?
 
Upvote 0
I'm realtively new to VBA, and have only used it in Excel. I guess I could look into it or get some help from someone in the office. It sounds like that would be the best solution.

Thanks for your replies.
 
Upvote 0

Forum statistics

Threads
1,214,430
Messages
6,119,453
Members
448,898
Latest member
drewmorgan128

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top