+ Reply to Thread
Results 1 to 9 of 9

Creating a macro to replace numbers

  1. #1
    Phil Tukey
    Guest

    Creating a macro to replace numbers

    I am having problems with macros. The problem is that I have a co-worker
    that wants to replace certain numbers with other numbers, but here the
    kicker. The numbers don't exist. For example.... he wants to replace 13.00
    (which is really 13) with 13.5. but he wants to replace all the numbers (ie
    24.00 or 15.00, which is just 24 and 15) with .5 after them. I have been
    trying to create a macro for this but have failed. Is there anyone out there
    who has dealt with this and who might be able to help me?



  2. #2

    Re: Creating a macro to replace numbers

    if you coworker only wants to add .5 to any value on the cells, u can
    do this:

    in a cell put a .5
    copy the value
    hilite the range to modify
    paste special add OK

    the value is added to each cell


  3. #3
    Bernard Liengme
    Guest

    Re: Creating a macro to replace numbers

    Firstly, there is no difference between 13 and 13.00; the same number is
    stored only the display differs.
    To add 0.5 to a selection of numbers:
    1) Enter 0.5 is a free cell and Copy it
    2) Select the cell to be changed; is they are non-contiguous hold CTRL while
    moving the mouse around
    3) Use menu command Edit | Paste Special -> Add
    4) Clear the cell with .5
    best wishes
    --
    Bernard V Liengme
    www.stfx.ca/people/bliengme
    remove caps from email

    "Phil Tukey" <[email protected]> wrote in message
    news:[email protected]...
    >I am having problems with macros. The problem is that I have a co-worker
    >that wants to replace certain numbers with other numbers, but here the
    >kicker. The numbers don't exist. For example.... he wants to replace 13.00
    >(which is really 13) with 13.5. but he wants to replace all the numbers (ie
    >24.00 or 15.00, which is just 24 and 15) with .5 after them. I have been
    >trying to create a macro for this but have failed. Is there anyone out
    >there who has dealt with this and who might be able to help me?
    >




  4. #4
    Phil Tukey
    Guest

    Re: Creating a macro to replace numbers

    Thats an Idea. But he wantes to replace all the numbers at the same time.
    You can't do it with the find and replace option, because Excel doesn't see
    ..00 as part of actual number. It sees it as a display. So I hope that helps
    clearify the problem.
    <[email protected]> wrote in message
    news:[email protected]...
    > if you coworker only wants to add .5 to any value on the cells, u can
    > do this:
    >
    > in a cell put a .5
    > copy the value
    > hilite the range to modify
    > paste special add OK
    >
    > the value is added to each cell
    >




  5. #5
    Phil Tukey
    Guest

    Re: Creating a macro to replace numbers

    Soory one more thing, it sounds like you are saying that you can replace the
    13 with .5 or are you saying that you can replace 13 with 13.5 by doing what
    you have suggested?
    "Phil Tukey" <[email protected]> wrote in message
    news:%[email protected]...
    > Thats an Idea. But he wantes to replace all the numbers at the same time.
    > You can't do it with the find and replace option, because Excel doesn't
    > see .00 as part of actual number. It sees it as a display. So I hope that
    > helps clearify the problem.
    > <[email protected]> wrote in message
    > news:[email protected]...
    >> if you coworker only wants to add .5 to any value on the cells, u can
    >> do this:
    >>
    >> in a cell put a .5
    >> copy the value
    >> hilite the range to modify
    >> paste special add OK
    >>
    >> the value is added to each cell
    >>

    >
    >




  6. #6

    Re: Creating a macro to replace numbers

    is the cell format TEXT ?

    "13.00" and 13.00 is not the same value.

    show us the macro thing plaz. may be...


  7. #7
    Bob Phillips
    Guest

    Re: Creating a macro to replace numbers

    That is a one-step operation, it is not find and replace. See Bernard's
    answer, it might be a tad clearer, although it is the same method.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Phil Tukey" <[email protected]> wrote in message
    news:%[email protected]...
    > Thats an Idea. But he wantes to replace all the numbers at the same time.
    > You can't do it with the find and replace option, because Excel doesn't

    see
    > .00 as part of actual number. It sees it as a display. So I hope that

    helps
    > clearify the problem.
    > <[email protected]> wrote in message
    > news:[email protected]...
    > > if you coworker only wants to add .5 to any value on the cells, u can
    > > do this:
    > >
    > > in a cell put a .5
    > > copy the value
    > > hilite the range to modify
    > > paste special add OK
    > >
    > > the value is added to each cell
    > >

    >
    >




  8. #8
    Phil Tukey
    Guest

    Re: Creating a macro to replace numbers

    Well that worked and I will show my co-worker and see what he thinks thanks
    for all your help.

    "Bob Phillips" <[email protected]> wrote in message
    news:[email protected]...
    > That is a one-step operation, it is not find and replace. See Bernard's
    > answer, it might be a tad clearer, although it is the same method.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "Phil Tukey" <[email protected]> wrote in message
    > news:%[email protected]...
    >> Thats an Idea. But he wantes to replace all the numbers at the same time.
    >> You can't do it with the find and replace option, because Excel doesn't

    > see
    >> .00 as part of actual number. It sees it as a display. So I hope that

    > helps
    >> clearify the problem.
    >> <[email protected]> wrote in message
    >> news:[email protected]...
    >> > if you coworker only wants to add .5 to any value on the cells, u can
    >> > do this:
    >> >
    >> > in a cell put a .5
    >> > copy the value
    >> > hilite the range to modify
    >> > paste special add OK
    >> >
    >> > the value is added to each cell
    >> >

    >>
    >>

    >
    >




  9. #9
    Phil Tukey
    Guest

    Re: Creating a macro to replace numbers

    Thank you that worked. Your a genious.
    "Bernard Liengme" <[email protected]> wrote in message
    news:[email protected]...
    > Firstly, there is no difference between 13 and 13.00; the same number is
    > stored only the display differs.
    > To add 0.5 to a selection of numbers:
    > 1) Enter 0.5 is a free cell and Copy it
    > 2) Select the cell to be changed; is they are non-contiguous hold CTRL
    > while moving the mouse around
    > 3) Use menu command Edit | Paste Special -> Add
    > 4) Clear the cell with .5
    > best wishes
    > --
    > Bernard V Liengme
    > www.stfx.ca/people/bliengme
    > remove caps from email
    >
    > "Phil Tukey" <[email protected]> wrote in message
    > news:[email protected]...
    >>I am having problems with macros. The problem is that I have a co-worker
    >>that wants to replace certain numbers with other numbers, but here the
    >>kicker. The numbers don't exist. For example.... he wants to replace 13.00
    >>(which is really 13) with 13.5. but he wants to replace all the numbers
    >>(ie 24.00 or 15.00, which is just 24 and 15) with .5 after them. I have
    >>been trying to create a macro for this but have failed. Is there anyone
    >>out there who has dealt with this and who might be able to help me?
    >>

    >
    >




+ 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