Create Folder

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
 
R

Rick Rothstein

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
 
K

K

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

Top