View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Vergel Adriano[_2_] Vergel Adriano[_2_] is offline
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 =----