Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel, how do I write a macro to convert the date value to text?

My worksheet contains several thousand records in which I have 3 columns with
date values. I need to know how to write a macro that would add a tick mark
to the beginning of each date to convert it to a text format.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Excel, how do I write a macro to convert the date value to text?

Sub ConvertDates()
Dim cell as Range
for each cell in selection
cell.value = "'" & cell.Text
cell.Numberformat = "General"
Next
End Sub

select the cells to convert and run the macro.

--
Regards,
Tom Ogilvy


"airedale girl" wrote:

My worksheet contains several thousand records in which I have 3 columns with
date values. I need to know how to write a macro that would add a tick mark
to the beginning of each date to convert it to a text format.

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
Excel - convert dates to text but appear as a date format Michele Excel Discussion (Misc queries) 3 May 21st 09 02:58 AM
How do I write a formula to convert numbers to written text? Jess Excel Worksheet Functions 2 April 25th 06 03:25 PM
Macro to convert text to date Nortos Excel Worksheet Functions 2 May 11th 05 10:42 AM
How do I convert a number formated as a date to text in Excel? BrotherNov Excel Discussion (Misc queries) 5 March 2nd 05 03:51 PM
Set Excel to not automatically convert text to date zleeperx Excel Programming 1 August 26th 03 09:06 PM


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