ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to subtract cells if... (https://www.excelbanter.com/excel-programming/438590-macro-subtract-cells-if.html)

Jodie

Macro to subtract cells if...
 
I need to write a macro that will search for the row that includes the word
"Guaranteed" and enter the value of the cell in column N of that row into the
cell in column N of the row just below the last row (the total row). Then,
subtract that value from the total (the row just above).

For example... column A includes a fund name in each row. Column B includes
values of these funds in each row. Some spreadsheets will have the fund
Guaranteed and some won't. If they do, I will need to subtract the value of
Guaranteed from the total of the funds. The last row has the total of the
funds in column B. The row directly below the total should show the value of
the Guaranteed fund and the following row would show the difference between
the total and the Guaranteed.

Can anyone help with this?
--
Thank you, Jodie

Don Guillett

Macro to subtract cells if...
 
If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Jodie" wrote in message
...
I need to write a macro that will search for the row that includes the word
"Guaranteed" and enter the value of the cell in column N of that row into
the
cell in column N of the row just below the last row (the total row).
Then,
subtract that value from the total (the row just above).

For example... column A includes a fund name in each row. Column B
includes
values of these funds in each row. Some spreadsheets will have the fund
Guaranteed and some won't. If they do, I will need to subtract the value
of
Guaranteed from the total of the funds. The last row has the total of the
funds in column B. The row directly below the total should show the value
of
the Guaranteed fund and the following row would show the difference
between
the total and the Guaranteed.

Can anyone help with this?
--
Thank you, Jodie




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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com