View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Don Don is offline
external usenet poster
 
Posts: 487
Default Exporting Time Formatted Numbers inside Macros

Thanks. I can probably do that, but I inherited these spreadsheets and I am
leery of adding columns that don't already exist. I am hoping that someone
can tell me how to code your suggestion in a Macro, because that is basically
how I feel the answer can be derived...just not sure on the syntax, at least
I hope it is just a "syntax" issue.

Thanks for the response.



"David Biddulph" wrote:

I don't know about all your macro stuff, but isn't the easiest way to have a
helper column of the form =TEXT(A1,"h:mm") , and export that?
--
David Biddulph

"Don" wrote in message
...
I have a Macro that exports certain pieces of data into a ".TXT" file.
Everything is working well, but today, I am trying to add to columns to
the
export file, both of which are stored as Custom "h:mm" time values.

Currently, for example, the following values are in the spreadsheet, and
when they arrive in mt text file, they look as follows:

6:15 ------ .260416666666667
15:06 ----- .629166666666667
6:45 ------ .28125
16:51 ----- .702083333333333

The commands to capture the values to be exported in my macro as as
follows:

ST2 = Range("K" + currow2).Value
ET2 = Range("L" + currow2).Value

Column K contains the 6:15 and 6:45 values from above, and column L
contains
15:06 and 16:51 (obviously all the values are in different rows of the
different columns)

I would like the export file to simply show 6:15, 15:06, 6:45, 16:51, as
they are in the spreadsheet.