LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
RzB RzB is offline
external usenet poster
 
Posts: 27
Default Date/Time - String or Number!

I am importing some data from a database via a VBA String.
One of the fields is a Date/Time in the form of
dd/yy/mm hh:dd:ss. I stick the string into a cell using

Set xLrngCell = Worksheets("Sheet1").Cells.Item(lngRowCount, lngColCount)
xLrngCell = strFieldContents

However when I go to the spreadsheet I find that some
of the dates will not convert to their numeric value.
If I try to format them as a General number some of
them convert but others stay as strings. If I edit one
of these strings (just removing and replacing one character)
it will "become" OK.

What is going on?

Thanks,
Roy


 
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
Counting number of rows between date range and meeting 2 string criteria Hii Sing Chung Excel Worksheet Functions 11 July 21st 09 12:34 AM
Change 3 letter text string to a number string Pete Excel Discussion (Misc queries) 3 December 31st 07 07:47 PM
convert string to date & time [email protected] Excel Worksheet Functions 4 October 30th 06 04:26 PM
Every time i put a number with period it becomes a date and time excelSOS Excel Discussion (Misc queries) 7 March 7th 06 12:20 AM
Counting number of time a character appears in a string Henrik Excel Worksheet Functions 5 October 20th 05 11:00 PM


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