Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a file in a directory of last months name

Status
Not open for further replies.

DellHater

Programmer
Nov 24, 2006
75
CZ
Hi

I need to amend my existing macro, so that instead of putting a file into a specific folder, I have to put it into a folder called last month.
For example

create a file called test.txt in a folder called C:\test\July
for this month and next month in a folder called C:\test\August

is there a quick way I can do this?

thanks
 



Hi,

Code:
LastMO = Format(DateSerial(Year(Date),Month(Date)-1, 1),"mmmm")


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
HI thanks for the quick response,

how can this be dropped in to a path name ??

currently
ChangeFileOpenDirectory _
"C:\test\"
how do I get the string value added to the path above ?

thx a lot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top