Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Please Help...Date converting to USA from UK when running Macro !!!


Hi

Below is the code from a macro I am running in Excel.

The prolem is that once the file is saved the dates are converted into
USA format from UK format and this is causing major problems..

Would appreciate any help please...

Sub format()
'
' format Macro
' format for data load
'

'
ActiveWorkbook.Save
ActiveSheet.Unprotect
Rows("1:11").Select
Selection.Delete Shift:=xlUp
Columns("B:B").Select
Selection.ClearContents
ActiveWorkbook.SaveAs Filename:="c:\payroll\Cleaners.csv", _
FileFormat:=6, CreateBackup:=False
ActiveWorkbook.Close Savechanges:=False
End Sub



Thanks

Paddy


--
padmaster
------------------------------------------------------------------------
padmaster's Profile: http://www.excelforum.com/member.php...o&userid=36433
View this thread: http://www.excelforum.com/showthread...hreadid=561993

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Please Help...Date converting to USA from UK when running Macro !!!


Dates are recorded as a number; today is 38915! The presentation is a
question of format, either in Excel or Windows (Local settings).
By the way the code you have posted does not seem to directly involve
dates.


--
raypayette


------------------------------------------------------------------------
raypayette's Profile: http://www.excelforum.com/member.php...o&userid=29569
View this thread: http://www.excelforum.com/showthread...hreadid=561993

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Please Help...Date converting to USA from UK when running Macro !!!


raypayette Wrote:
Dates are recorded as a number; today is 38915! The presentation is a
question of format, either in Excel or Windows (Local settings).
By the way the code you have posted does not seem to directly involve
dates.


Sorry, the code is part of the macro....this macro is to convert an
excel file into a csv file and it is the dates within the files that
are being changed from a UK format to a USA one...

Any help is appreciated....
Paddy


--
padmaster
------------------------------------------------------------------------
padmaster's Profile: http://www.excelforum.com/member.php...o&userid=36433
View this thread: http://www.excelforum.com/showthread...hreadid=561993

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Please Help...Date converting to USA from UK when running Macro !!!


padmaster Wrote:
Sorry, the code is part of the macro....this macro is to convert a
excel file into a csv file and it is the dates within the files tha
are being changed from a UK format to a USA one...

Any help is appreciated....
Paddy



Sorted !!!

Range("c:c").NumberFormat = "dd/mm/yyyy"

Where c:c is the range

This ensures the format is correct in the macro...

Thanks for all your help

--
padmaste
-----------------------------------------------------------------------
padmaster's Profile: http://www.excelforum.com/member.php...fo&userid=3643
View this thread: http://www.excelforum.com/showthread.php?threadid=56199

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
Converting hijri date to gregorian date Ramil Marbella Excel Discussion (Misc queries) 1 May 5th 21 10:08 AM
Converting a date to a text field w/o converting it to a julian da LynnMinn Excel Worksheet Functions 2 March 6th 08 03:43 PM
Converting a year date into a specific day date jonny Charts and Charting in Excel 1 July 4th 07 09:06 PM
converting date from a textbox to a date format neowok[_17_] Excel Programming 5 February 23rd 04 01:40 PM
Converting a string date into a Excel Date Phillips Excel Programming 0 November 24th 03 08:54 PM


All times are GMT +1. The time now is 05:30 PM.

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

About Us

"It's about Microsoft Excel"