Create Folder

  • Thread starter Thread starter K
  • Start date Start date
K

K

Hi all, I want macro which should create folder with name "2009" in
"C:\My Documents\Years" and if there is already folder with name
"2009" in "C:\My Documents\Years" then macro should do nothing.
Please can any friend can help
 
I guess this could also be done without the error checking... I think this
will work

DirName = "C:\My Documents\Years\2009"
If Dir(DirName, vbDirectory) = "" Then MkDir DirName
 
I guess this could also be done without the error checking... I think this
will work

DirName = "C:\My Documents\Years\2009"
If Dir(DirName, vbDirectory) = "" Then MkDir DirName

--
Rick (MVP - Excel)






- Show quoted text -

Thanks Rick its brilliant
 

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