Using VBA in Excel to Make a Folder to Save Workbooks in

  • Thread starter Thread starter Jeff Marshall
  • Start date Start date
J

Jeff Marshall

Hi ,

I have a cell(1,1) that has the text "Sept" in it and cell(1,2) has "03" in
it.
Is there a way to make a folder in C:\My documents\Invoices, that would name
the folder "Sept-03" ?

(I would like to make a macro that I run once a month that would make this
new folder naming it the month and year so I could save invoices made out to
different companies to it)

Thanks in advance for any help offered.
Jeff Marshall x23
 
Hi

Or this

Private Sub CommandButton1_Click()

On Error GoTo waserror

ChDrive "C"
ChDir "C:\"
ChDir "C:\my documents\invoices\"
MkDir Cells(1, "a") & " - " & Cells(1, "b")
Exit Sub

waserror:
MsgBox ("Folder may already exist. Please check")

End Sub


HTH

Ken
 
Back
Top