Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default date format cell, to text format

i have column "C" formated as a date format ("dd-mmm-yy").
I did this by selecting column c and then clicking formatcellsdate..and
selecting "14-Mar-98" in right hand section.

So when i enter 40018 into cell "C1" then cell reads "24-Jul-09"

i need to put some statement into the adjacent cell ("D1") which if
formatted as "text", so it reads the cell content not the value.

i.e range("C1").value="400018", I need to have "D1" read "24-Jul-09". I
tried to copy and paste special but there is no "Text" option.

My problem is that there are around a 20,000 rows popolated. How can
iachieve this please?

Sunil


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default date format cell, to text format

Enter this formula in D1:
=TEXT(C1,"dd-mm-yy")
Regards,
Stefi

€˛sunilpatel€¯ ezt Ć*rta:

i have column "C" formated as a date format ("dd-mmm-yy").
I did this by selecting column c and then clicking formatcellsdate..and
selecting "14-Mar-98" in right hand section.

So when i enter 40018 into cell "C1" then cell reads "24-Jul-09"

i need to put some statement into the adjacent cell ("D1") which if
formatted as "text", so it reads the cell content not the value.

i.e range("C1").value="400018", I need to have "D1" read "24-Jul-09". I
tried to copy and paste special but there is no "Text" option.

My problem is that there are around a 20,000 rows popolated. How can
iachieve this please?

Sunil



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default date format cell, to text format

Right click the tab at the bottom of the worksheet that is to have this
functionality, select View Code from the pop up menu that appears and
copy/paste the following into the code window that opened up...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 3 And IsDate(Target.Value) Then
If CDate(Target.Value) < DateSerial(1900, 1, 1) Then Exit Sub
Application.EnableEvents = False
With Target.Offset(, 1)
.NumberFormat = "@"
.Value = Format(Target.Value, "dd-mmm-yy")
End With
Application.EnableEvents = True
End If
End Sub

Now, go back to your worksheet... whenever you enter a valid Excel date in
Column C, the text entry you want will automatically be made into Column D.

--
Rick (MVP - Excel)


"sunilpatel" wrote in message
...
i have column "C" formated as a date format ("dd-mmm-yy").
I did this by selecting column c and then clicking formatcellsdate..and
selecting "14-Mar-98" in right hand section.

So when i enter 40018 into cell "C1" then cell reads "24-Jul-09"

i need to put some statement into the adjacent cell ("D1") which if
formatted as "text", so it reads the cell content not the value.

i.e range("C1").value="400018", I need to have "D1" read "24-Jul-09". I
tried to copy and paste special but there is no "Text" option.

My problem is that there are around a 20,000 rows popolated. How can
iachieve this please?

Sunil



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
date format cell, to text format Mishell Excel Programming 0 August 31st 09 12:26 PM
Need help with converting CUSTOM format/TEXT format to DATE format Deo Cleto Excel Worksheet Functions 6 June 2nd 09 08:14 PM
Change Date Format to Specific Text Format When Copying [email protected] Excel Discussion (Misc queries) 4 December 23rd 08 03:43 PM
code to convert date from TEXT format (03-02) to DATE format (200203) Gauthier[_2_] Excel Programming 0 September 22nd 04 03:26 PM
Change a date in text format xx.xx.20xx to a recognised date format concatenator Excel Programming 1 November 24th 03 11:33 PM


All times are GMT +1. The time now is 04:06 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"