LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 337
Default Format problem

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
 
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
Excel Format Problem - Date Overrides Format Mary Excel Discussion (Misc queries) 5 February 10th 10 05:49 AM
General Format to Custom format problem KELC-F/A Excel Discussion (Misc queries) 1 May 2nd 08 09:51 PM
format problem bz Excel Programming 3 November 21st 06 05:37 PM
Format Problem Amjad Excel Discussion (Misc queries) 1 September 12th 05 10:07 AM
Format problem Gary Excel Discussion (Misc queries) 4 July 3rd 05 02:57 PM


All times are GMT +1. The time now is 01:56 PM.

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"