Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 75
Default Saving with name and date macro

Hi i hope someone can help me.
I'm trying to set up a macro to save a work book with the name taken from
cell B5 and the date in B6, but after saving i then i need it to stay on the
original book and not on the newly saved one.
Can anyone help please?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Saving with name and date macro


Without specifying a path this will save in My Documents:

Code:
--------------------

ActiveWorkbook.SaveCopyAs (ActiveSheet.Range("B5").Value & " - " & Format(ActiveSheet.Range("B6"), "dd - mmm - yy") & ".xls")


--------------------


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=35583

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Saving with name and date macro

Option Explicit
Sub Testme()
Dim myFileName As String
Dim myPath As String
myPath = "C:\somefoldernamehere\"
With ActiveWorkbook.Worksheets("sheet1")
myFileName = .Range("b5").Value _
& "-" _
& Format(.Range("B6").Value, "yyyy-mm-dd") & ".xls"
.Parent.SaveCopyAs Filename:=myFileName
End With
End Sub

This doesn't have any validity checks at all!


Bobby wrote:

Hi i hope someone can help me.
I'm trying to set up a macro to save a work book with the name taken from
cell B5 and the date in B6, but after saving i then i need it to stay on the
original book and not on the newly saved one.
Can anyone help please?


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 75
Default Saving with name and date macro

Thank You for the replies Guys, your help, once again has got me what i
needed.

"Dave Peterson" wrote:

Option Explicit
Sub Testme()
Dim myFileName As String
Dim myPath As String
myPath = "C:\somefoldernamehere\"
With ActiveWorkbook.Worksheets("sheet1")
myFileName = .Range("b5").Value _
& "-" _
& Format(.Range("B6").Value, "yyyy-mm-dd") & ".xls"
.Parent.SaveCopyAs Filename:=myFileName
End With
End Sub

This doesn't have any validity checks at all!


Bobby wrote:

Hi i hope someone can help me.
I'm trying to set up a macro to save a work book with the name taken from
cell B5 and the date in B6, but after saving i then i need it to stay on the
original book and not on the newly saved one.
Can anyone help please?


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Saving with name and date macro


Glad you got what you need, however Dave's is the one to go with really!Bobby;158440 Wrote:
Thank You for the replies Guys, your help, once again has got me what i
needed.

"Dave Peterson" wrote:

Option Explicit
Sub Testme()
Dim myFileName As String
Dim myPath As String
myPath = "C:\somefoldernamehere\"
With ActiveWorkbook.Worksheets("sheet1")
myFileName = .Range("b5").Value _
& "-" _
& Format(.Range("B6").Value, "yyyy-mm-dd") & ".xls"
.Parent.SaveCopyAs Filename:=myFileName
End With
End Sub

This doesn't have any validity checks at all!


Bobby wrote:

Hi i hope someone can help me.
I'm trying to set up a macro to save a work book with the name

taken from
cell B5 and the date in B6, but after saving i then i need it to

stay on the
original book and not on the newly saved one.
Can anyone help please?


--

Dave Peterson



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=35583

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
Saving Macro whatzzup Excel Discussion (Misc queries) 2 April 24th 08 09:22 AM
Help with saving a Macro Keepsmiling1228 Excel Worksheet Functions 1 April 2nd 08 12:31 AM
Saving a macro Bill New Users to Excel 1 July 12th 07 08:53 AM
Saving with Macro mabbutt Excel Discussion (Misc queries) 2 May 11th 06 03:39 PM
Saving without Macro mrbalaje Excel Discussion (Misc queries) 0 May 6th 05 11:41 AM


All times are GMT +1. The time now is 11:46 PM.

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"