View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
K[_2_] K[_2_] is offline
external usenet poster
 
Posts: 557
Default NEED MACRO TO GET BALANCE

Hi, Please see the detail below which i got on my spreadsheet

# A B C D---------Coloumns
1 100---------------------------------Budget Amount in Cell A1
2 G1 20 10-----------------Data from Cell A2 to C6
3 30 03
4 SS 15
5 13 14
6 TT 18 19

i want macro to calculate balance in coloumn D cells. the Balance
should be calculated the
way that it should minus first coloumn C figure and if there is no
figure in coloumn C then it
should minus coloumn B figure but if there is code in coloumn A cell
then it should not minus
any of that row figure and should put text in coloumn D cell that "NOT
CORRECT" and then
carry on down to the next cell
FOR EXAMPLE: in row 2 there is code "G1" in cell A2 and figure 20 in
cell B2 and also figure
10 in cell C2. now macro should check that if there is nothing in cell
A2 then it should minus
first cell C2 figure but if there is nothing in cell C2 then it should
look in cell B2 and minus that
figure and give the balance in cell D2. but as above i have code "G1"
in cell A2 so now macro
should not minus any figure which are in cells C2 and B2 but just put
text in cell D2 that
"NOT CORRECT". and like this macro should carry on working down to
next cell.
Note: that if there is nothing in cell C2 and B2 then cell D2 should
show nothing.
I hope i done my best to explain what i am trying to say and achive.
If any of my online
friend can come up with any formula in coloumn D cell that will be
also good but please
make sure that it should do all the work which i mentioned above.
Please if anybody can
give his precious time to sort out my this problem then i'll be very
thankful