+ Reply to Thread
Results 1 to 11 of 11

Find and Replace Using Time Format

  1. #1
    Registered User
    Join Date
    12-26-2015
    Location
    Las Vegas
    MS-Off Ver
    2013
    Posts
    56

    Find and Replace Using Time Format

    Hello Gurus,

    The file in question is attached.

    I'm trying to use a find and replace VBA to eliminate "0:0" and replace with "" ... but it doesn't seem to work for me.

    You may notice that some cells do not have "0:0" and only have "0:35" etc... those should stay the same.

    The macro also needs to loop through each cell.

    Any help is GREATLY APPRECIATED!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,914

    Re: Find and Replace Using Time Format

    .... ...
    Last edited by Phuocam; 11-12-2016 at 12:57 AM.

  3. #3
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Find and Replace Using Time Format

    Please Login or Register  to view this content.
    Kind regards
    Leo

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Find and Replace Using Time Format

    Use autofilter like
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-26-2015
    Location
    Las Vegas
    MS-Off Ver
    2013
    Posts
    56

    Re: Find and Replace Using Time Format

    Thanks for the responses guys, but none of these worked for me... did they work for you?

    each cell with this format 0:01:39 would become 1:39...

    and

    each cell with this format 0:35 would stay the same...

    This is what I was playing with:

    Sub dude()

    Columns("A").Replace What:="0:0", _
    Replacement:="", _
    LookAt:=xlPart, _
    SearchOrder:=xlByRows, _
    MatchCase:=False, _
    SearchFormat:=False, _
    ReplaceFormat:=False

    End Sub

    Any more ideas?

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Find and Replace Using Time Format

    You have 0:01:39 in A2, 0:00:00 (0:00 as in cell) in A13, 0:35:00 (0:35 as in cell) in A21, 0:1d 3:17 in A136.
    Column is formatted as time "h:mm:ss".

    How do you want them as a result?

  7. #7
    Registered User
    Join Date
    12-26-2015
    Location
    Las Vegas
    MS-Off Ver
    2013
    Posts
    56

    Re: Find and Replace Using Time Format

    Attached is how I get the raw data. I think this will help.

    My goal is to convert each cell to hh:mm:ss

    Obviously the extra text hr/min in the box will need to be removed before the conversion.

    Maybe the hours and minutes need to be converted to seconds first to format to hh:mm:ss?

    Any ideas?
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Find and Replace Using Time Format

    See if this is how you wanted.
    Please Login or Register  to view this content.

  9. #9
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Find and Replace Using Time Format

    Or

    Please Login or Register  to view this content.
    Kind regards
    Leo

  10. #10
    Registered User
    Join Date
    12-26-2015
    Location
    Las Vegas
    MS-Off Ver
    2013
    Posts
    56

    Re: Find and Replace Using Time Format

    Perfect Jindon thank you!

  11. #11
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Find and Replace Using Time Format

    i could be wrong, but my calculation has 27 hours and 17 minutes voor cell A136


    Kind regards
    Leo

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. general vba code format to Find and Replace
    By saravanan1981 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-22-2016, 09:25 AM
  2. Find and Replace based on format.
    By onlineuk in forum Excel General
    Replies: 6
    Last Post: 05-01-2012, 09:33 AM
  3. Find and Replace one cell at a time
    By jstites in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-15-2009, 04:26 PM
  4. find and replace format
    By juicejug in forum Excel General
    Replies: 1
    Last Post: 05-19-2009, 01:55 PM
  5. [SOLVED] Find & Replace text format
    By jmn13 in forum Excel General
    Replies: 2
    Last Post: 05-25-2006, 01:25 PM
  6. find replace format
    By neeraj in forum Excel General
    Replies: 6
    Last Post: 09-20-2005, 01:05 PM
  7. [SOLVED] Find/replace format?
    By Gordon in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-03-2005, 03:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1