ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Saving to a certain month folder (https://www.excelbanter.com/excel-programming/360966-saving-certain-month-folder.html)

Stephen

Saving to a certain month folder
 
Hi Folks,

I'm hoping this can be accomplishedin a macro...

A user opens an excel file and fills out the necessary info for the prior
days usage. I can create the button which links to the macro that saves the
file as the previous days date and emails it as an attachment, but I would
like the file to know where to save itself according to the month of the save
as date.

I have a folder named "2006" and subfolders named "January", February",
etc... Is there a way through a macro to have the file save in the correct
months' folder?

Priya[_4_]

Saving to a certain month folder
 
You can use

Dim strFileName as string

strFileName = "Beginning of the path" & Year(Now()) & "\" &
format(now()),"MMMM") & "\" & "rest of the path"

ActiveWorkbook.Saveas strFileName

Priya

"Stephen" wrote in message
...
Hi Folks,

I'm hoping this can be accomplishedin a macro...

A user opens an excel file and fills out the necessary info for the prior
days usage. I can create the button which links to the macro that saves
the
file as the previous days date and emails it as an attachment, but I would
like the file to know where to save itself according to the month of the
save
as date.

I have a folder named "2006" and subfolders named "January", February",
etc... Is there a way through a macro to have the file save in the correct
months' folder?




Stephen

Saving to a certain month folder
 
Good stuff... works like a charm.

Thanks! I appreciate the fast reply!

"Priya" wrote:

You can use

Dim strFileName as string

strFileName = "Beginning of the path" & Year(Now()) & "\" &
format(now()),"MMMM") & "\" & "rest of the path"

ActiveWorkbook.Saveas strFileName

Priya

"Stephen" wrote in message
...
Hi Folks,

I'm hoping this can be accomplishedin a macro...

A user opens an excel file and fills out the necessary info for the prior
days usage. I can create the button which links to the macro that saves
the
file as the previous days date and emails it as an attachment, but I would
like the file to know where to save itself according to the month of the
save
as date.

I have a folder named "2006" and subfolders named "January", February",
etc... Is there a way through a macro to have the file save in the correct
months' folder?






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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com