LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Perplexing string manipulation problem

Thank you so much, Rick! This works beautifully, and is ever so much more
elegant than my attempt. Do you suppose anyone can tell that I'm just an
old, rusty COBOL programmer who's not particularly conversant in VBA? LOL!

Now on to the flip side of this coin: trying to convert seconds back into a
dd:hh:mm:ss text value. We'll see if this old dog has learned any new tricks!

"Rick Rothstein (MVP - VB)" wrote:

I'm not sure what your problem is, but I think this function does what you
are attempting to do with your function (plus it is a little bit
shorter<g)...

Function TimeInSeconds(BuildTime As String) As Long
Dim X As Long
Dim Factors As Variant
Dim Parts() As String
Factors = Array(1, 60, 3600, 86400)
Parts = Split(BuildTime, ":")
For X = 0 To UBound(Parts)
TimeInSeconds = TimeInSeconds + Factors(X) * Parts(UBound(Parts) - X)
Next
End Function

Rick



 
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
String manipulation problem [email protected] Excel Programming 1 May 2nd 06 05:18 PM
Importing Long String - String Manipulation (INVRPT) (EDI EANCOM 96a) Brian Excel Programming 3 February 9th 06 03:38 PM
Importing Long String - String Manipulation (EDI EANCOM 96a) Brian Excel Programming 6 February 9th 06 12:27 PM
String manipulation Ray Batig Excel Programming 2 March 17th 05 02:42 AM
Help with perplexing form problem Frustrated Excel Programming 6 April 26th 04 09:21 PM


All times are GMT +1. The time now is 06:47 AM.

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"