ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Conditional (https://www.excelbanter.com/excel-programming/293335-conditional.html)

ksnapp[_15_]

Conditional
 
Hello,

I have a column that countains fee discriptions and every now and then
a total fees cell. In the next row to the right I have the amount of
those fees and a blank cell next to the total cell. I need to put a
total in that blank cell that is the total of about 1/2 dozen different
kinds of fees, but not all of the fees that are on the sheet.

Can this be done w/ a sub? Does anybody have an example for me?


---
Message posted from http://www.ExcelForum.com/


Frank Kabel

Conditional
 
Hi
not quite sure what you're trying to achieve. You may post some example
rows (plain text, no attachments please) and describe your desired
result

--
Regards
Frank Kabel
Frankfurt, Germany

Hello,

I have a column that countains fee discriptions and every now and

then
a total fees cell. In the next row to the right I have the amount of
those fees and a blank cell next to the total cell. I need to put a
total in that blank cell that is the total of about 1/2 dozen
different kinds of fees, but not all of the fees that are on the
sheet.

Can this be done w/ a sub? Does anybody have an example for me?


---
Message posted from http://www.ExcelForum.com/



ksnapp[_20_]

Conditional
 
Fee Discription $

total fee
ticket 10
light 50
transit 10
total fee

lets say i need to fill the cells to the lft of the "Total fee" cel
with the sum of ticket and transit fees.

one million thank you

--
Message posted from http://www.ExcelForum.com


Frank Kabel

Conditional
 
Hi
should the result in 'total fee' be dynamic or is it sufficient to run
a macro ones and insert the values? If yes try the following:
- select you cells which you want to process (thats is in your example
column B):
- start the following macro

sub total_insert()
dim rng as range
dim cell as range
dim ret_value
set rng = selection
ret_value=0
for each cell in rng
if cell.offset(0,-1).value="total fee" then
cell.value= ret_value
ret_value = 0
elseif cell.offset(0,-1).value = "ticket" or
cell.offset(0,-1).value = "transit" then
ret_value = ret_value + cell.value
end if
next
end sub


--
Regards
Frank Kabel
Frankfurt, Germany

Fee Discription $

total fee
ticket 10
light 50
transit 10
total fee

lets say i need to fill the cells to the lft of the "Total fee" cell
with the sum of ticket and transit fees.

one million thank yous


---
Message posted from http://www.ExcelForum.com/




All times are GMT +1. The time now is 12:05 PM.

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