Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Could you do PostingDate.NumberFormat="dd/mm/yy" after PostingDate =
..Cells(RSRow, 5)? "john pritchard" wrote in message ... Hi, All I really want to do is read a cell and write its contents. The contents happen to be a date in UK format i.e. 31/07/03 means March 31 2003 and 01/08/03 means August 1 2003. Originally I simply had:- PostingDate = .Cells(RSRow, 5) in the appropriate with structure etc with postingdate defined as a string. Later this was written to another sheet with :- Cells(LSRow, 18) = PostingDate which writes 31/07/03 as expected when that is what is read BUT 37629 when 01/08/03 is read. I've tried reformating the Cells in the code with :- .Cells(RSRow, 5).NumberFormat = "dd/mm/yy" PostingDate = .Cells(RSRow, 5) and converting to text with :- .Cells(RSRow, 5).NumberFormat = "@" I've also tried using datepart but if I do that 31/07/03 results in year 1931 while 01/08/03 gets 2003. The macro / VB code is distributed to many PC's and I have no control over the PC's settings. The original input file is created with Crystal Reports (I have no control here either) and the relevant cell is General format to start with. As you can imagine inability to read/write 01/08/03 is embarassing to say the least! Thanks for any suggestions JP |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Printing Excel in PDF format | Excel Discussion (Misc queries) | |||
Excel 2007 Large Format Printing Issue | Excel Discussion (Misc queries) | |||
Format change after printing in excel | Excel Discussion (Misc queries) | |||
problems with printing format for excel table in Publisher 2003 | Excel Discussion (Misc queries) | |||
printing workbook -landscap in to portrait format in Excel | Excel Discussion (Misc queries) |