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

I save files "name +date" such as. "dell may 03" date
always has the last six spaces . i.e. next month will
be "dell jun 03"

I am looking for a macro that after completing procedures
in a workbook would open the "Save As" dialog box and 1.
remove the previous date 2. save the file as "name + new
date" The update is always done in the month of the file
date.

Any help would be very much appreciated.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Save As Macro

Try this.


Private Sub CommandButton1_Click()

tmpName = Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 10)

Select Case Month(Now())
Case 1
tmpMonth = "Jan "
Case 2
tmpMonth = "Feb "
Case 3
tmpMonth = "Mar "
End Select

tmpYear = Right(Year(Now()), 2)

ActiveWorkbook.SaveAs FileName:="C:\WINDOWS\Desktop\" _
& tmpName & tmpMonth & tmpYear, _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

End Sub




Michael Tomasura
"Ronbo" wrote in message
...
I save files "name +date" such as. "dell may 03" date
always has the last six spaces . i.e. next month will
be "dell jun 03"

I am looking for a macro that after completing procedures
in a workbook would open the "Save As" dialog box and 1.
remove the previous date 2. save the file as "name + new
date" The update is always done in the month of the file
date.

Any help would be very much appreciated.




  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Save As Macro


-----Original Message-----
Try this.


Private Sub CommandButton1_Click()

tmpName = Left(ActiveWorkbook.Name, Len

(ActiveWorkbook.Name) - 10)

Select Case Month(Now())
Case 1
tmpMonth = "Jan "
Case 2
tmpMonth = "Feb "
Case 3
tmpMonth = "Mar "
End Select

tmpYear = Right(Year(Now()), 2)

ActiveWorkbook.SaveAs

FileName:="C:\WINDOWS\Desktop\" _
& tmpName & tmpMonth & tmpYear, _
FileFormat:=xlNormal, Password:="",

WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

End Sub




Michael Tomasura
"Ronbo" wrote in

message
...
I save files "name +date" such as. "dell may 03" date
always has the last six spaces . i.e. next month will
be "dell jun 03"

I am looking for a macro that after completing

procedures
in a workbook would open the "Save As" dialog box and

1.
remove the previous date 2. save the file as "name +

new
date" The update is always done in the month of the

file
date.

Any help would be very much appreciated.




.
Thanks a lot for your help. It is getting me on the

way. The trouble I am having at this point is that it is
putting the name in twice i.e. "delldell feb 04" and two
it is putting it into the wrong (parent) directory and I
have changed your desktop dir to the correct one.

Again. thanks a lot for your help. If you can add any
further suggestions, they would be appreciated.

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
Macro to Insert Current Date into cell - Macro to "Save As" Guy[_2_] Excel Worksheet Functions 4 December 12th 08 08:20 PM
Macro (SAVE AS) Tom Excel Discussion (Misc queries) 1 September 26th 07 02:41 PM
Save As Macro el zorro[_2_] Excel Discussion (Misc queries) 3 July 18th 07 12:28 AM
Macro to Save without the Save Message Ellen G Excel Discussion (Misc queries) 4 February 23rd 07 08:52 PM
Prompted to save changes after macro save - why? Izar Arcturus Excel Programming 2 December 10th 03 09:27 PM


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