Thread: Create Folder
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
K[_2_] K[_2_] is offline
external usenet poster
 
Posts: 557
Default Create Folder

On Feb 4, 7:30*pm, "Rick Rothstein"
wrote:
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)

"Bob Phillips" wrote in message

...



On Error Resume Next
MkDir "C:\My Documents\Years\2009"
On Error Goto 0


--
__________________________________
HTH


Bob


"K" wrote in message
...
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- Hide quoted text -


- Show quoted text -


Thanks Rick its brilliant