PC Review


Reply
Thread Tools Rate Thread

Creating a macro to replace numbers

 
 
Phil Tukey
Guest
Posts: n/a
 
      18th Aug 2005
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 With Quote
 
 
 
 
roer.garcia@gmail.com
Guest
Posts: n/a
 
      18th Aug 2005
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

 
Reply With Quote
 
Bernard Liengme
Guest
Posts: n/a
 
      18th Aug 2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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 With Quote
 
Phil Tukey
Guest
Posts: n/a
 
      18th Aug 2005
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.
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
Phil Tukey
Guest
Posts: n/a
 
      18th Aug 2005
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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.
> <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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
>>

>
>



 
Reply With Quote
 
roer.garcia@gmail.com
Guest
Posts: n/a
 
      18th Aug 2005
is the cell format TEXT ?

"13.00" and 13.00 is not the same value.

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

 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      18th Aug 2005
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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.
> <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
> >

>
>



 
Reply With Quote
 
Phil Tukey
Guest
Posts: n/a
 
      18th Aug 2005
Well that worked and I will show my co-worker and see what he thinks thanks
for all your help.

"Bob Phillips" <(E-Mail Removed)> wrote in message
news:OE$(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> 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.
>> <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > 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
>> >

>>
>>

>
>



 
Reply With Quote
 
Phil Tukey
Guest
Posts: n/a
 
      18th Aug 2005
Thank you that worked. Your a genious.
"Bernard Liengme" <(E-Mail Removed)> wrote in message
news:uI$(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a macro to find and replace text =?Utf-8?B?TG91aXNl?= Microsoft Excel Worksheet Functions 10 8th Jun 2005 10:29 AM
Creating macro for find and replace hidaya Microsoft Excel Misc 4 29th Jun 2004 01:58 PM
Macro to replace numbers in certain columns? John Microsoft Excel Worksheet Functions 1 14th Dec 2003 04:22 AM
Re: Macro to replace negative numbers by 0 William Microsoft Excel Programming 0 1st Sep 2003 05:52 AM
Re: Macro to replace negative numbers by 0 Patrick Molloy Microsoft Excel Programming 0 1st Sep 2003 05:27 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:01 PM.