How to create a new folder using Excel VBA?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My users may or may not have a folder called "C:\Audits".
When they run a certain macro, it should check to see if the folder exists,
and if it does not, create it and then save As the open Excel workbook to the
Audit folder under a new name.

Any ideas on how to check for/create the Audit folder from within Excel?

TIA
Paul
 
The prior replies would probably work..
You could also use variations on the following to test for existence of
directory. It would be true if no directory exists and a Make Directory
command would be appropriate.
If dir(“C:\Auditsâ€)<> “C:\Auditsâ€
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top