LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
David McRitchie
 
Posts: n/a
Default

Would suggest you convert them to Excel dates. The following
macro will convert a text string of numbers or a number of 8 digits
to Excel date format. The the formatting will match the short date
format in your regional settings (control panel).

Sub Fixmmddyyyy()
Dim cell As Range
Selection.NumberFormat = "mm/dd/yyyy"
On Error Resume Next
For Each cell In Selection
If Len(cell) = 8 Then
cell.Value = DateSerial(Right(cell.Value, 4), _
Left(cell.Value, 2), Mid(cell.Value, 3, 2))
End If
Next cell
End Sub

Test on a copy of your worksheet. Should be safe to reuse
on a column that is already converted because the length will
no longer be 8.

If not familiar with installing and using macros see
http://www.mvps.org/dmcritchie/excel/getstarted.htm

More information on Date and Time in
http://www.mvps.org/dmcritchie/excel/datetime.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"DraCo" wrote in message ...
How do I insert a seperator (/) into a number string (20050822) to format a
date column? This number string is brought in from an outside source and
cannot be manipulated by the program (AccPac) generating the string.



 
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
Seed numbers for random number generation, uniform distribution darebo Excel Discussion (Misc queries) 3 April 21st 23 09:02 PM
trim a string by specific number of characters windyoldman Excel Discussion (Misc queries) 2 July 13th 05 01:53 PM
How do I insert 2 decimal places to a number in cell? Rebecca Martinez Excel Worksheet Functions 6 July 7th 05 07:12 PM
insert picture BillGwyer Excel Discussion (Misc queries) 1 March 4th 05 06:37 PM
Insert value of a cell as a filename Ralph Howarth Excel Worksheet Functions 0 January 18th 05 12:03 AM


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