Hi everyone. I'm new to VBA and new to this site.
I need to automate a few tasks in a file, then saveas to a folder. I need to see if the folder exists. If not, create the folder. I have a start. Could someone please let me know how to accomplish this? I'm not sure what matters here... I'm using VBA in Excel 2003 on an XP Pro system.
The folder should be in the root of C: and be called 'P2P User Folder' or something similar.
Sub Master()
'
' Master Macro
' Macro recorded 4/20/2006 by CompuCat
'
' Keyboard Shortcut: Ctrl+m
'
Application.DisplayAlerts = False
Rows("1:1").Select
Range("F1").Activate
Selection.Delete Shift:=xlUp
Columns("P:P").Select
Selection.Delete Shift:=xlToLeft
[This is where I need to see if the folder exists, and then create it, if it does not]
ChDir "C:\P2P User Folder"
ActiveWorkbook.SaveAs Filename:= _
"C:\P2P User Folder\newuser.csv" _
, FileFormat:=xlCSV, CreateBackup:=False
ActiveWorkbook.SaveAs Filename:= _
"C:\P2P User Folder\chguser.csv" _
, FileFormat:=xlCSV, CreateBackup:=False
End Sub
Thanks, and I appreciate any advice you have.
CompuCat