Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
In Excel 2003, how do I automate file naming/saving + date? | Setting up and Configuration of Excel | |||
Naming a workbook WITHOUT saving it? | Excel Programming | |||
Naming a workbook WITHOUT saving it? | Excel Programming | |||
Naming a workbook WITHOUT saving it? | Excel Programming | |||
Saving a Workbook: Forcing User to Rename before Saving | Excel Programming |