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.
 

Some videos you may like

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

VicRauch

Well-known Member
Joined
Mar 23, 2006
Messages
2,032
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
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,831
Office Version
  1. 365
Platform
  1. Windows
Dan

Why not convert the macro to 'proper' VBA?
 

dmagnus

Board Regular
Joined
Dec 16, 2005
Messages
66
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,109,360
Messages
5,528,233
Members
409,809
Latest member
VICKRAM

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top