Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Using VBA in Excel to Make a Folder to Save Workbooks in

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Using VBA in Excel to Make a Folder to Save Workbooks in

Try

ChDir "C:\My documents\Invoices"
MkDir Format(Now, "mmm-yy")

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Jeff Marshall" wrote in message ...
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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Using VBA in Excel to Make a Folder to Save Workbooks in

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


"Jeff Marshall" wrote in message
...
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





---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 19/08/2003


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy folder with excel linked workbooks lightbulb Excel Discussion (Misc queries) 1 June 20th 08 06:01 PM
excel says folder is read only and cannot save kylle200 Setting up and Configuration of Excel 0 May 17th 06 07:29 AM
Need code to save file to new folder, erase from old folder Ron M. Excel Discussion (Misc queries) 1 February 24th 06 06:02 PM
"Save As" folder -- can I default this to the same folder as origi Mike Excel Discussion (Misc queries) 1 June 11th 05 12:06 AM
How do I save an excel folder to disk? Cookie New Users to Excel 5 February 23rd 05 10:24 PM


All times are GMT +1. The time now is 07:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"