Thread
:
Format problem
View Single Post
#
2
Posted to microsoft.public.excel.programming
Don Guillett
external usenet poster
Posts: 10,124
Format problem
try
Set DateSave = format(Worksheets("Summaryk").Range("E213"),"m-d-yy")
--
Don Guillett
SalesAid Software
"Oldjay" wrote in message
...
When I try to save the file it fails because DateSave is formated 5/1/07
even thou E213 is formated 5-1-07
Is there any way to force the DateSave to 5-1-07 and also can the existing
code be simplified J
Private Sub CommandButton4_Click() 'Saves wookbook and exits
Dim NameSave As Range
Dim DateSave As Range
Sheets("Checkbook").Select
Set NameSave = Worksheets("Summary").Range("A2")
Set DateSave = Worksheets("Summaryk").Range("E213")
Workbooks.Add
ActiveWorkbook.SaveAs Filename:="TempData.xls"
Windows("Bank Records.XLS").Activate
Application.GoTo Reference:="Database"
Selection.Copy
Windows("TempData.XLS").Activate
Range("A1").Select
ActiveSheet.Paste
BankRecords = InputBox("Please enter file name to save", "Bank Records
Backup", "C:\Bank Records\" & NameSave & "" & DateSave)
ActiveWorkbook.SaveAs Filename:=BankRecords + "xls"
ActiveWorkbook.Close
oldjay
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett