Hello I am trying to modify a macro
I want it to maximize so that net income matches spending day to day. the Macro works great
Where I would like to automate it more is that now it will insert numbers in K even though the funds in T are depleted (red conditioning)
What I would like it to do is to look at column T and see if there are funds if yes insert calculated number from macro in K
If not write in K7 last funds left in this case 7119.64 from t6.
next 2 lines should be 0
then funds are ok so 6312 is correct
Thank-you
I want it to maximize so that net income matches spending day to day. the Macro works great
Where I would like to automate it more is that now it will insert numbers in K even though the funds in T are depleted (red conditioning)
What I would like it to do is to look at column T and see if there are funds if yes insert calculated number from macro in K
If not write in K7 last funds left in this case 7119.64 from t6.
next 2 lines should be 0
then funds are ok so 6312 is correct
Thank-you
VBA Code:
Sub GoalSeekWithMultipleCellsA()
Dim J As Integer
For J = 4 To 45
Cells(J, "E").GoalSeek Goal:=Cells(J, "D"), ChangingCell:=Cells(J, "k")
Next J
For J = 4 To 45
Cells(J, "E").GoalSeek Goal:=Cells(J, "D"), ChangingCell:=Cells(J, "l")
Next J
For J = 4 To 45
Cells(J, "E").GoalSeek Goal:=Cells(J, "D"), ChangingCell:=Cells(J, "N")
Next J
End Sub
Cell Formulas | ||
---|---|---|
Range | Formula | |
B4:B14 | B4 | =C4-(YEAR(Summary!$C$5)) |
C4 | C4 | =YEAR(Summary!$C$7) |
D4 | D4 | =Summary!C44 |
E4:E14 | E4 | =O4-Q4 |
C5:C14 | C5 | =C4+1 |
D5 | D5 | =((D4*Summary!$C$17)+D4) |
D6:D14,G12:H14 | D6 | =(D5*Summary!$C$17)+D5 |
O4,O6:O14 | O4 | =SUM(G4:N4) |
P4:P14 | P4 | =M4+J4+G4+H4+Investments!H5+Investments!K5 |
Q4 | Q4 | =SUMIF('Income Tax Table'!B4:B16,Summary!C52,'Income Tax Table'!D4:D16) |
R4:R14 | R4 | =Q4/P4 |
S4:S14 | S4 | =Investments!C5 |
T4:T14 | T4 | =Investments!E5 |
U4:U14 | U4 | =Investments!I5 |
V4:V14 | V4 | =Investments!L5 |
W4:W14 | W4 | =Investments!O5 |
O5 | O5 | =SUM(G5:N5)-I4 |
Q5 | Q5 | =SUMIF('Income Tax Table'!B4:B16,Summary!C52,'Income Tax Table'!E4:E16) |
Q6 | Q6 | =SUMIF('Income Tax Table'!B4:B16,Summary!C52,'Income Tax Table'!F4:F16) |
Q7 | Q7 | =SUMIF('Income Tax Table'!B4:B16,Summary!C52,'Income Tax Table'!G4:G16) |
Q8 | Q8 | =SUMIF('Income Tax Table'!B4:B16,Summary!C52,'Income Tax Table'!H4:H16) |
Q9 | Q9 | =SUMIF('Income Tax Table'!B4:B16,Summary!C52,'Income Tax Table'!I4:I16) |
Q10 | Q10 | =SUMIF('Income Tax Table'!B4:B16,Summary!C52,'Income Tax Table'!J4:J16) |
Q11 | Q11 | =SUMIF('Income Tax Table'!B4:B16,Summary!C52,'Income Tax Table'!K4:K16) |
Q12 | Q12 | =SUMIF('Income Tax Table'!B4:B16,Summary!C52,'Income Tax Table'!L4:L16) |
Q13 | Q13 | =SUMIF('Income Tax Table'!B4:B16,Summary!C52,'Income Tax Table'!M4:M16) |
Q14 | Q14 | =SUMIF('Income Tax Table'!B4:B16,Summary!C52,'Income Tax Table'!N4:N16) |
Cells with Conditional Formatting | ||||
---|---|---|---|---|
Cell | Condition | Cell Format | Stop If True | |
M4:M45 | Expression | =$M4>VLOOKUP(C4-1,Investments!$A$4:$O$46,15) | text | NO |
L4:L45 | Expression | =$L4>VLOOKUP(C4-1,Investments!$A$4:$I$46,9) | text | NO |
K4:K45 | Expression | =$K4>VLOOKUP(C4-1,Investments!$A$4:$E$46,5) | text | NO |
N4:N45 | Expression | =$N4>VLOOKUP(C4-1,Investments!$A$4:$L$46,12) | text | NO |