Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default changing directories

I'm at somewhat of a standstill in my current project, and could use a
little help. I have a series of monthly workbooks that contain daily
data. I'm in the process of automating the creation of the daily
worksheets, so that the end-user only has to enter the information.

What I need to do now, is when the month rolls over, save the workbook
as a different file name, and in a folder that doesn't exist until the
file needs to go there. For example, the current workbook is saved
in:

"F:\assistant\SHIPPING\Daily Inv Report\October 2003\October
Inventory.xls"

When November rolls around, I need to save it as:

"F:\assistant\SHIPPING\Daily Inv Report\November 2003\November
Inventory.xls"

But the directory for November (or any month in the future) might not
exist yet. From here, I have two questions:

1. Is it possible to create a new folder using an excel macro?
2. Is it possible to use a string or integer variable as part of the
path name? such as:
"\" & strMonth & " " & strYear & "\"
.... something like that?


Any help regarding this will be greatly appreciated.

Thanks,
Andrea
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default changing directories

Andrea,

The MkDir statement creates a new directory. Try something like

MkDir "F:\assistant\SHIPPING\Daily Inv Report\" & _
strMonth & " " & strYear


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Andrea" wrote in message
om...
I'm at somewhat of a standstill in my current project, and could use a
little help. I have a series of monthly workbooks that contain daily
data. I'm in the process of automating the creation of the daily
worksheets, so that the end-user only has to enter the information.

What I need to do now, is when the month rolls over, save the workbook
as a different file name, and in a folder that doesn't exist until the
file needs to go there. For example, the current workbook is saved
in:

"F:\assistant\SHIPPING\Daily Inv Report\October 2003\October
Inventory.xls"

When November rolls around, I need to save it as:

"F:\assistant\SHIPPING\Daily Inv Report\November 2003\November
Inventory.xls"

But the directory for November (or any month in the future) might not
exist yet. From here, I have two questions:

1. Is it possible to create a new folder using an excel macro?
2. Is it possible to use a string or integer variable as part of the
path name? such as:
"\" & strMonth & " " & strYear & "\"
... something like that?


Any help regarding this will be greatly appreciated.

Thanks,
Andrea



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default changing directories


Thanks Chip! I'm still learning all of the functionality of VB in
excel, and I didn't know how to create a folder. Thanks for the info!
It is appreciated... believe me!

Andrea

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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
excels slows when changing directories ALBERT GOZLAN Excel Discussion (Misc queries) 1 January 9th 08 08:37 AM
Simplify changing directories BobS9895 Excel Worksheet Functions 0 July 18th 06 07:22 PM
creating directories freekrill Excel Discussion (Misc queries) 1 July 25th 05 09:26 AM
Searching directories... Keith Willshaw Excel Programming 0 August 1st 03 09:20 AM
Searching directories... Phobos Excel Programming 0 August 1st 03 12:03 AM


All times are GMT +1. The time now is 10:25 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"