View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff Harald Staff is offline
external usenet poster
 
Posts: 1,327
Default Test if a folder exists, create if it doesn't?

Hi

Try this:

Sub GoThere()
Dim NewFolder As String
NewFolder = "C:\Temp\NewOne"

On Error Resume Next
MkDir NewFolder
ChDrive NewFolder
ChDir NewFolder
'demo:
Application.Dialogs(xlDialogOpen).Show
End Sub


--
HTH. Best wishes Harald
Followup to newsgroup only please

"43fan" skrev i melding
...
I'm sure this is simple, but after going through the Excel help file, all

it
has done is confuse me. ;) Basically, I just want to see if a folder
exists, if it does, change to the folder, if it doesn't, create it, then
change to there.

I'll be getting user inputs that will be concatenated to come up with the
folder name I'm looking for/changing to. As well, I'll use that same info
to name some files that will be saved into that folder.

Thanks!!
Shawn
PS - sorry for a double post, had to set my date back to run an update,

and
forgot to change it to the correct day before I posted this before.



--
Join the newest in Fantasy Sports.

http://www.6FantasySports.com
(this site supports the Victory Junction Gang Camp with a portion of all
proceeds)