Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
DA DA is offline
external usenet poster
 
Posts: 104
Default Macro for replacing data

Hi
If I want to replace 0 with a name above zero, is there a way to do it? I
have about 350 names to replace, where the zero is under the name row. I got
the zero when tried to get a sub total of hours and amount columns (not
shown).

thank you and Happy New Year.


8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 Total 0
14 LECOURS
14 LECOURS
14 LECOURS
14 LECOURS
14 LECOURS
14 LECOURS
14 LECOURS
14 LECOURS
14 LECOURS
14 Total 0
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 Total 0

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 72
Default Macro for replacing data

Hi There Da,

Many different ways you can achieve this without macros. I would try
inserting a formula in column C starting in Row 2 that says:

=IF(B2=0,+B1,B2)

Copy it down to the bottom of you data and make sure you are geting the
desired result.

then Copy Paste Special Values it over Column B and delete the formula from
Column C.

You could alternately use a formula that says:

=IF(RIGHT(A2,2)="al",+B1,+B2)

and do the same with it as the previous suggestion.

HTH and Good Luck,

Matt

"da" wrote:

Hi
If I want to replace 0 with a name above zero, is there a way to do it? I
have about 350 names to replace, where the zero is under the name row. I got
the zero when tried to get a sub total of hours and amount columns (not
shown).

thank you and Happy New Year.


8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 Total 0
14 LECOURS
14 LECOURS
14 LECOURS
14 LECOURS
14 LECOURS
14 LECOURS
14 LECOURS
14 LECOURS
14 LECOURS
14 Total 0
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 Total 0

  #4   Report Post  
Posted to microsoft.public.excel.misc
DA DA is offline
external usenet poster
 
Posts: 104
Default Macro for replacing data

Thanks for your help. The formula works; I copied it for few names and it
worked. However, I have over 35,000 records and I have to insert the formula
at each sub-total row for each name. There are over 400 names in the
spreadsheet, which makes it very cumbersome to use the formula. I may have to
copy the last name for each name. Anyway, thanks for your help.

"veryeavy" wrote:

Hi There Da,

Many different ways you can achieve this without macros. I would try
inserting a formula in column C starting in Row 2 that says:

=IF(B2=0,+B1,B2)

Copy it down to the bottom of you data and make sure you are geting the
desired result.

then Copy Paste Special Values it over Column B and delete the formula from
Column C.

You could alternately use a formula that says:

=IF(RIGHT(A2,2)="al",+B1,+B2)

and do the same with it as the previous suggestion.

HTH and Good Luck,

Matt

"da" wrote:

Hi
If I want to replace 0 with a name above zero, is there a way to do it? I
have about 350 names to replace, where the zero is under the name row. I got
the zero when tried to get a sub total of hours and amount columns (not
shown).

thank you and Happy New Year.


8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 Total 0
14 LECOURS
14 LECOURS
14 LECOURS
14 LECOURS
14 LECOURS
14 LECOURS
14 LECOURS
14 LECOURS
14 LECOURS
14 Total 0
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 Total 0

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Macro for replacing data

If desired, send me a sample workbook with a clear explanation and
before/after examples

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"da" wrote in message
...
Thanks for your help. The formula works; I copied it for few names and it
worked. However, I have over 35,000 records and I have to insert the
formula
at each sub-total row for each name. There are over 400 names in the
spreadsheet, which makes it very cumbersome to use the formula. I may have
to
copy the last name for each name. Anyway, thanks for your help.

"veryeavy" wrote:

Hi There Da,

Many different ways you can achieve this without macros. I would try
inserting a formula in column C starting in Row 2 that says:

=IF(B2=0,+B1,B2)

Copy it down to the bottom of you data and make sure you are geting the
desired result.

then Copy Paste Special Values it over Column B and delete the formula
from
Column C.

You could alternately use a formula that says:

=IF(RIGHT(A2,2)="al",+B1,+B2)

and do the same with it as the previous suggestion.

HTH and Good Luck,

Matt

"da" wrote:

Hi
If I want to replace 0 with a name above zero, is there a way to do it?
I
have about 350 names to replace, where the zero is under the name row.
I got
the zero when tried to get a sub total of hours and amount columns (not
shown).

thank you and Happy New Year.


8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 SANTIAGO
8 Total 0
14 LECOURS
14 LECOURS
14 LECOURS
14 LECOURS
14 LECOURS
14 LECOURS
14 LECOURS
14 LECOURS
14 LECOURS
14 Total 0
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 BRUNO
25 Total 0


Reply
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
Macro Help replacing dropped zeros [email protected] Excel Discussion (Misc queries) 5 September 2nd 06 06:08 PM
Macro replacing links [email protected] Excel Discussion (Misc queries) 1 August 10th 06 04:08 PM
replacing macro? beatrice25 Excel Discussion (Misc queries) 5 June 21st 06 01:33 AM
Macro help:replacing figures phil2006 Excel Discussion (Misc queries) 0 June 5th 06 02:40 PM
In a Macro replacing $x with ($x + i) gives x+1 not $x+1 as expe. zorro New Users to Excel 0 March 3rd 06 05:28 AM


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

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"