Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default m/d/yyyy h:mm date conversion to yyyymmdd ???

I want to use the functionality of excel/vb to change the
actual current value of a cell, for example, 7/9/2003 9:41
to "20030709".

The current format of the cell is custom m/d/yyyy h:mm. I
need the actual value of the cell to be 20030709, not a
formula or the excel date/time serial number. I am
uploading this file to a Physical File on an AS/400. It's
easy enough for me to manipulate the field once I get the
data to the AS/400, I just would like to try to format the
data correctly in the spreadsheet before uploading...just
looking to see what I can/cannot do in excel/vb.

I've used a for/next loop in a macro to change date cells
to text using text to columns, now I want to do the same
but change the date format to YYYYMMDD also. The end
result of the cell must be actual data, not a
formula. Is this doable?

Here is what I've used in the past:

Dim CurCell As Object
Columns("H:H").Select
For Each CurCell In Selection
If CurCell.Value < "" Then CurCell.TextToColumns
Destination:=CurCell,
DataType:=xlFixedWidth, _
OtherChar:="/", FieldInfo:=Array(0, 2)
Next

Once again, any help is appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default m/d/yyyy h:mm date conversion to yyyymmdd ???

See answers in misc NG



On Wed, 9 Jul 2003 15:18:48 -0700, "Jeff" wrote:

I want to use the functionality of excel/vb to change the
actual current value of a cell, for example, 7/9/2003 9:41
to "20030709".

The current format of the cell is custom m/d/yyyy h:mm. I
need the actual value of the cell to be 20030709, not a
formula or the excel date/time serial number. I am
uploading this file to a Physical File on an AS/400. It's
easy enough for me to manipulate the field once I get the
data to the AS/400, I just would like to try to format the
data correctly in the spreadsheet before uploading...just
looking to see what I can/cannot do in excel/vb.

I've used a for/next loop in a macro to change date cells
to text using text to columns, now I want to do the same
but change the date format to YYYYMMDD also. The end
result of the cell must be actual data, not a
formula. Is this doable?

Here is what I've used in the past:

Dim CurCell As Object
Columns("H:H").Select
For Each CurCell In Selection
If CurCell.Value < "" Then CurCell.TextToColumns
Destination:=CurCell,
DataType:=xlFixedWidth, _
OtherChar:="/", FieldInfo:=Array(0, 2)
Next

Once again, any help is appreciated.


--ron
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
how do I convert date format yyyymmdd to mm/dd/yyyy Datahead Excel Worksheet Functions 3 May 11th 23 11:45 AM
how do I change the date format from yyyymmdd to mm/dd/yyyy Charlene Excel Worksheet Functions 5 May 6th 23 07:46 PM
Date Conversion dd.mm.yyyy to dd/mm/yyyy ScottRA Excel Worksheet Functions 1 September 5th 07 06:42 AM
basically want to go from mm/dd/yyyy to yyyymmdd clegge Excel Worksheet Functions 2 January 10th 06 04:41 PM
date conversion from m/d/yyyy to yyyymmdd jeff Excel Programming 3 July 10th 03 03:50 AM


All times are GMT +1. The time now is 01:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"