Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 150
Default Problem formatting date as "dd/mm/yyyy"

Hi,

I am formatting cells using the following code: sws1 is the source
sheet and dws is the destination sheet.

dws.Cells(datarow, 3) = Format(sws1.Cells(j, 6), "dd/mm/yyyy")

The value of "31-03-2010" in sws1 is displayed as "31-03-2010" in
dws and not as "31/03/2010" as desired. The cell in dws is formatted
as general

The value of "12-03-2010" in sws1 is displayed as "03-12-10" in dws
and not as "12/03/2010" The cell in dws is formatted as date.

The dates in the sws1 sheet are formatted as dates

Please help iwith the correct code formatting to display as desired.

Thanks in advance for the help.

Regards,
Raj
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Problem formatting date as "dd/mm/yyyy"

Try

dws.Cells(datarow, 3) = sws1.Cells(j, 6).Value
dws.Cells(datarow, 3).NumberFormat = "dd/mm/yyyy"

--
Jacob (MVP - Excel)


"Raj" wrote:

Hi,

I am formatting cells using the following code: sws1 is the source
sheet and dws is the destination sheet.

dws.Cells(datarow, 3) = Format(sws1.Cells(j, 6), "dd/mm/yyyy")

The value of "31-03-2010" in sws1 is displayed as "31-03-2010" in
dws and not as "31/03/2010" as desired. The cell in dws is formatted
as general

The value of "12-03-2010" in sws1 is displayed as "03-12-10" in dws
and not as "12/03/2010" The cell in dws is formatted as date.

The dates in the sws1 sheet are formatted as dates

Please help iwith the correct code formatting to display as desired.

Thanks in advance for the help.

Regards,
Raj
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem formatting date as "dd/mm/yyyy"

Hi,

Raj please format the destination cell as "dd/mm/yyyy"

right click the cell, click on format cell, select custom in number tab,
then in the Type box please type "dd/mm/yyyy" press ok

Regards,

Usman

"Raj" wrote:

Hi,

I am formatting cells using the following code: sws1 is the source
sheet and dws is the destination sheet.

dws.Cells(datarow, 3) = Format(sws1.Cells(j, 6), "dd/mm/yyyy")

The value of "31-03-2010" in sws1 is displayed as "31-03-2010" in
dws and not as "31/03/2010" as desired. The cell in dws is formatted
as general

The value of "12-03-2010" in sws1 is displayed as "03-12-10" in dws
and not as "12/03/2010" The cell in dws is formatted as date.

The dates in the sws1 sheet are formatted as dates

Please help iwith the correct code formatting to display as desired.

Thanks in advance for the help.

Regards,
Raj
.

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
user to input date as "yyyy" in cell David Excel Programming 1 February 24th 10 09:52 AM
Excel VBA to convert "dd.MM.yy" text to "dd/MM/yyyy" format date? Paul J[_2_] Excel Programming 4 July 11th 07 11:32 AM
Convert text "date" (DDMMMYY) to datetime value of YYYY-MM-DD - ho j.a. harriman Excel Discussion (Misc queries) 7 March 29th 07 01:20 AM
Using "dd/mm/yyyy h:mm" on Date Variables ExcelMonkey Excel Programming 1 February 23rd 06 01:28 PM
Option Explicit and Date Format "dd mmm yyyy"? Rob van Gelder[_4_] Excel Programming 11 November 10th 04 10:13 PM


All times are GMT +1. The time now is 10:42 AM.

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"