Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Naming and saving a workbook

I want to be able to open a new workbook (which I can do) then save it as
workbook name + (value in B1 on open workbook, which will be a date).xls

How do I do this. I can open the workbook and name it and save it, but I
want to be able to add the date in B1 to the name.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Naming and saving a workbook

Post the code that you have so far...
--
HTH...

Jim Thomlinson


"Kevin Porter" wrote:

I want to be able to open a new workbook (which I can do) then save it as
workbook name + (value in B1 on open workbook, which will be a date).xls

How do I do this. I can open the workbook and name it and save it, but I
want to be able to add the date in B1 to the name.

Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Naming and saving a workbook

Sub CreateDetailWB()
'
' CreateDetailWB Macro
' Macro recorded 2/20/2007 by Kevin Porter
'

'
Dim WBDate As String

WBDate = Workbooks("SRA Payroll Details.xlt").Sheets("List").Cells(A2)
Workbooks.Add
Sheets("Sheet3").Select
ActiveWindow.SelectedSheets.Delete
Sheets("Sheet2").Select
ActiveWindow.SelectedSheets.Delete
ChDir "\\dc\SRAO\Intuit\Payroll 2007"
ActiveWorkbook.SaveAs Filename:= _
"\\dc\SRAO\Intuit\Payroll 2007\SRA Detailed Payroll - " & WBDate &
".xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False

End Sub


"Jim Thomlinson" wrote:

Post the code that you have so far...
--
HTH...

Jim Thomlinson


"Kevin Porter" wrote:

I want to be able to open a new workbook (which I can do) then save it as
workbook name + (value in B1 on open workbook, which will be a date).xls

How do I do this. I can open the workbook and name it and save it, but I
want to be able to add the date in B1 to the name.

Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Naming and saving a workbook

Do you mean cell A2 in SRA Payroll Details contains the date you want to add
to the filename? If so, then:

WBDate = Format(Workbooks("SRA Payroll
Details.xlt").Sheets("List").Cells(A2), "yyyymmdd")




"Kevin Porter" wrote in message
...
Sub CreateDetailWB()
'
' CreateDetailWB Macro
' Macro recorded 2/20/2007 by Kevin Porter
'

'
Dim WBDate As String

WBDate = Workbooks("SRA Payroll Details.xlt").Sheets("List").Cells(A2)
Workbooks.Add
Sheets("Sheet3").Select
ActiveWindow.SelectedSheets.Delete
Sheets("Sheet2").Select
ActiveWindow.SelectedSheets.Delete
ChDir "\\dc\SRAO\Intuit\Payroll 2007"
ActiveWorkbook.SaveAs Filename:= _
"\\dc\SRAO\Intuit\Payroll 2007\SRA Detailed Payroll - " & WBDate &
".xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False

End Sub


"Jim Thomlinson" wrote:

Post the code that you have so far...
--
HTH...

Jim Thomlinson


"Kevin Porter" wrote:

I want to be able to open a new workbook (which I can do) then save it
as
workbook name + (value in B1 on open workbook, which will be a
date).xls

How do I do this. I can open the workbook and name it and save it, but
I
want to be able to add the date in B1 to the name.

Thanks.





----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Naming and saving a workbook

correction:

WBDate = Format(Workbooks("SRA Payroll
Details.xlt").Sheets("List").Range("A2").text, "yyyymmdd")



"Vergel Adriano" wrote in message
...
Do you mean cell A2 in SRA Payroll Details contains the date you want to
add to the filename? If so, then:

WBDate = Format(Workbooks("SRA Payroll
Details.xlt").Sheets("List").Cells(A2), "yyyymmdd")




"Kevin Porter" wrote in message
...
Sub CreateDetailWB()
'
' CreateDetailWB Macro
' Macro recorded 2/20/2007 by Kevin Porter
'

'
Dim WBDate As String

WBDate = Workbooks("SRA Payroll Details.xlt").Sheets("List").Cells(A2)
Workbooks.Add
Sheets("Sheet3").Select
ActiveWindow.SelectedSheets.Delete
Sheets("Sheet2").Select
ActiveWindow.SelectedSheets.Delete
ChDir "\\dc\SRAO\Intuit\Payroll 2007"
ActiveWorkbook.SaveAs Filename:= _
"\\dc\SRAO\Intuit\Payroll 2007\SRA Detailed Payroll - " & WBDate &
".xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False

End Sub


"Jim Thomlinson" wrote:

Post the code that you have so far...
--
HTH...

Jim Thomlinson


"Kevin Porter" wrote:

I want to be able to open a new workbook (which I can do) then save it
as
workbook name + (value in B1 on open workbook, which will be a
date).xls

How do I do this. I can open the workbook and name it and save it,
but I
want to be able to add the date in B1 to the name.

Thanks.





----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet
News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+
Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption
=----




----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Naming and saving a workbook

Seems to me, using the Text property to pass a date string to format would
increase the possibility of misinterpretation which would be avoided by
using Value

WBDate = Format(Workbooks("SRA Payroll
Details.xlt").Sheets("List").Range("A2").Value, "yyyymmdd")

--
Regards,
Tom Ogilvy

"Vergel Adriano" wrote:

correction:

WBDate = Format(Workbooks("SRA Payroll
Details.xlt").Sheets("List").Range("A2").text, "yyyymmdd")



"Vergel Adriano" wrote in message
...
Do you mean cell A2 in SRA Payroll Details contains the date you want to
add to the filename? If so, then:

WBDate = Format(Workbooks("SRA Payroll
Details.xlt").Sheets("List").Cells(A2), "yyyymmdd")




"Kevin Porter" wrote in message
...
Sub CreateDetailWB()
'
' CreateDetailWB Macro
' Macro recorded 2/20/2007 by Kevin Porter
'

'
Dim WBDate As String

WBDate = Workbooks("SRA Payroll Details.xlt").Sheets("List").Cells(A2)
Workbooks.Add
Sheets("Sheet3").Select
ActiveWindow.SelectedSheets.Delete
Sheets("Sheet2").Select
ActiveWindow.SelectedSheets.Delete
ChDir "\\dc\SRAO\Intuit\Payroll 2007"
ActiveWorkbook.SaveAs Filename:= _
"\\dc\SRAO\Intuit\Payroll 2007\SRA Detailed Payroll - " & WBDate &
".xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False

End Sub


"Jim Thomlinson" wrote:

Post the code that you have so far...
--
HTH...

Jim Thomlinson


"Kevin Porter" wrote:

I want to be able to open a new workbook (which I can do) then save it
as
workbook name + (value in B1 on open workbook, which will be a
date).xls

How do I do this. I can open the workbook and name it and save it,
but I
want to be able to add the date in B1 to the name.

Thanks.




----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet
News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+
Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption
=----




----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Naming and saving a workbook

Thank you. Worked like a dream.

"Vergel Adriano" wrote:

correction:

WBDate = Format(Workbooks("SRA Payroll
Details.xlt").Sheets("List").Range("A2").text, "yyyymmdd")



"Vergel Adriano" wrote in message
...
Do you mean cell A2 in SRA Payroll Details contains the date you want to
add to the filename? If so, then:

WBDate = Format(Workbooks("SRA Payroll
Details.xlt").Sheets("List").Cells(A2), "yyyymmdd")




"Kevin Porter" wrote in message
...
Sub CreateDetailWB()
'
' CreateDetailWB Macro
' Macro recorded 2/20/2007 by Kevin Porter
'

'
Dim WBDate As String

WBDate = Workbooks("SRA Payroll Details.xlt").Sheets("List").Cells(A2)
Workbooks.Add
Sheets("Sheet3").Select
ActiveWindow.SelectedSheets.Delete
Sheets("Sheet2").Select
ActiveWindow.SelectedSheets.Delete
ChDir "\\dc\SRAO\Intuit\Payroll 2007"
ActiveWorkbook.SaveAs Filename:= _
"\\dc\SRAO\Intuit\Payroll 2007\SRA Detailed Payroll - " & WBDate &
".xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False

End Sub


"Jim Thomlinson" wrote:

Post the code that you have so far...
--
HTH...

Jim Thomlinson


"Kevin Porter" wrote:

I want to be able to open a new workbook (which I can do) then save it
as
workbook name + (value in B1 on open workbook, which will be a
date).xls

How do I do this. I can open the workbook and name it and save it,
but I
want to be able to add the date in B1 to the name.

Thanks.




----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet
News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+
Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption
=----




----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

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
In Excel 2003, how do I automate file naming/saving + date? MichaelOfficer Setting up and Configuration of Excel 1 July 19th 09 01:46 PM
Naming a workbook WITHOUT saving it? Maury Markowitz Excel Programming 1 March 21st 06 06:44 PM
Naming a workbook WITHOUT saving it? Tom Ogilvy Excel Programming 0 March 21st 06 06:41 PM
Naming a workbook WITHOUT saving it? Tom Ogilvy Excel Programming 1 March 21st 06 06:40 PM
Saving a Workbook: Forcing User to Rename before Saving Rollin_Again[_6_] Excel Programming 5 April 16th 04 02:54 PM


All times are GMT +1. The time now is 02:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"