I have written a macro to name a file that the user has created based on a date range in the format ‘dd-ddmmyyyyy-xxx’ where ‘xxx’ is a category that is applied to the file name from a choice the user has made from a userform.
Temporarily, I store the filename in a hidden file that contains the code then remove the filename from the hidden file when the user closes the created file that has used the stored filename.
The above is the procedure for when the user creates a new file from a CSV file.
My question is how can I store the filename when the user does not create a new file but uses an existing named file to create their ‘new’ file? For example, in a previous session, they may have created a file named ’07-13032002-ALL’ (meaning a file with ALL categories for the 7th to the 13th of March 2002).
I cannot determine how to capture the opened file name (e.g. ’07-13032002-ALL’ so that they can do some filtering of the content and then save it as ’07-13032002-CAT2′) The user needs to keep both files with their filenames.
Any suggestions?