+ Reply to Thread
Results 1 to 4 of 4

macro issue with numbers

  1. #1
    Registered User
    Join Date
    10-12-2005
    Posts
    9

    macro issue with numbers

    hi there,

    i am trying to record a macro that will help speed up some data problems I have. I'd like to take a series of data that is formatted like this: 00:00:41:02 and make it 00:41:02:00. i successfully created a macro that will delete the first 00: and then append a :00 onto the end of that type of string. however, pretending 00:00:41:02 is the cell i created the macro on, once i run the macro, it overwrites the number that exists in the following cells. so, as an example 00:00:50:10 would become 00:00:41:02 instead of 00:50:10:00. obviously, my macro isn't very useful in it's current state.

    is there some sort of wildcard character that can tell a macro to maintain the numbers that exist in subsequent cells? i tried what i thought might be obvious things, but to no avail.

    thanks in advance for any advice.

    gwinn

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by exceldoofus
    hi there,

    i am trying to record a macro that will help speed up some data problems I have. I'd like to take a series of data that is formatted like this: 00:00:41:02 and make it 00:41:02:00. i successfully created a macro that will delete the first 00: and then append a :00 onto the end of that type of string. however, pretending 00:00:41:02 is the cell i created the macro on, once i run the macro, it overwrites the number that exists in the following cells. so, as an example 00:00:50:10 would become 00:00:41:02 instead of 00:50:10:00. obviously, my macro isn't very useful in it's current state.

    is there some sort of wildcard character that can tell a macro to maintain the numbers that exist in subsequent cells? i tried what i thought might be obvious things, but to no avail.

    thanks in advance for any advice.

    gwinn
    With your cells formatted as Text
    Please Login or Register  to view this content.
    should work (for column G)

    ---
    Si fractum non sit, noli id reficere.

  3. #3
    Registered User
    Join Date
    10-12-2005
    Posts
    9
    Hmmm...that didn't seem to work, but it was likely how I added in that code. I wasn't sure where to insert the text. Excel didn't like it, and now it won't let me record marcros at all and it obliterated the old one I had! Assuming I can get excel to forgive me and allow me to record a new macro, where do I insert the code string? Here's an empty macro from a different xls.

    Sub Macro3()
    '
    ' Macro3 Macro
    ' Macro recorded 10/23/2006 by
    '
    ' Keyboard Shortcut: Ctrl+w
    '
    Range("C9").Select
    End Sub

  4. #4
    Registered User
    Join Date
    10-12-2005
    Posts
    9
    NEVERMIND! I figured out where I'd gone wrong on my own, and it worked. Thanks!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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