LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 852
Default Add to a "number as text"



With a list of text as these two examples, (each in one cell, A1, A2 etc.)

03:04 stuff etc things whatever
04:23 bla bla bla bla

How can I add say, 5 seconds to the :04 and the :23
And have the list look like this:

03:09 stuff etc things whatever
04:28 bla bla bla bla

And it might be good to know how to add 1.05 to the strings and have it look like this:

04:09 stuff etc things whatever
05:28 bla bla bla bla


This code pulls the correct seconds strings out but I'm lost on how to add to 5 to a "number as text" and throw it back into the text statement.

To add 1.05, the code would need to be changed to include the minutes and seconds is my guess.

Thanks,
Howard


Sub StringAddFour()

Dim LRow As Long
Dim aRng As Range
Dim c As Range
Dim strMid As String

LRow = Cells(Rows.Count, "A").End(xlUp).Row
Set aRng = Range("A1:A" & Cells(Rows.Count, "A").End(xlUp).Row)

For Each c In aRng
With c
strMid = Mid(c, 4, 2)
MsgBox strMid
End With
Next

End Sub
 
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 i convert "100" to "hundred"( number to text) in excel-2007 mohanraj Excel Worksheet Functions 1 May 11th 08 09:07 PM
macro for converting number stored as "text" (or preceeded with ') to "number" formatting markx Excel Programming 1 June 30th 06 12:14 PM
macro for converting number stored as "text" (or preceeded with ') to "number" formatting markx Excel Programming 1 June 23rd 06 03:15 PM
how to converts a number to text eg. "2" become "two" CQ New Users to Excel 3 February 18th 06 08:25 PM
how to converts a number to text eg. "2" become "two" CQ New Users to Excel 1 February 17th 06 04:10 AM


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