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

Hi
One column contains excel dates, formatted like: 2009-11-09.
What I need is to programmatically create a new column containing text only:
20091109
Any help higly appreciated!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default copy date to text

Hi,

Try this

Sub stance()
Dim MyRange As Range
Dim LastRow As Long
LastRow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
Set MyRange = Range("A1:A" & LastRow)
For Each c In MyRange
c.Offset(, 1).Value = Format(c.Value, "yyyymmdd")
Next
End Sub


Mike

"ulfb" wrote:

Hi
One column contains excel dates, formatted like: 2009-11-09.
What I need is to programmatically create a new column containing text only:
20091109
Any help higly appreciated!


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
Dragging Text or Date Fields to Copy billbrandi Excel Discussion (Misc queries) 1 May 24th 09 11:30 PM
Copy a calculated date in EXCEL as text martinPP Excel Discussion (Misc queries) 4 March 10th 09 03:25 PM
Prevent text converting to date in copy&pasting tables patrickj Excel Discussion (Misc queries) 0 January 23rd 08 01:38 AM
Copy Date to Text knowshowrosegrows Excel Discussion (Misc queries) 2 October 25th 07 09:43 PM
Enter date in text box - copy to worksheet cell Francis Brown Excel Programming 2 October 20th 05 02:40 PM


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