Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub stringdate()
For Each c In Range("f8:f12") c.Offset(, 1) = CStr(Format(c.Value, "yyyymmdd")) Next c End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Mike H" wrote in message ... 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Dragging Text or Date Fields to Copy | Excel Discussion (Misc queries) | |||
Copy a calculated date in EXCEL as text | Excel Discussion (Misc queries) | |||
Prevent text converting to date in copy&pasting tables | Excel Discussion (Misc queries) | |||
Copy Date to Text | Excel Discussion (Misc queries) | |||
Enter date in text box - copy to worksheet cell | Excel Programming |