VBA Goal seek - Range

MrKjetil

New Member
Joined
Dec 13, 2018
Messages
2
Hi!

I've got probably a simple question, but I cant't find the answer (Google, forums etc)..

I'm not very good at VBA. That said, I manage to work out a Goal Seek function ta Works 95%.. I work in a bank and has to find out how many years a loan could spand over (term loan? - sorry my English), given som factors. But in Goal Seek the result has to be more than 0,1 (I've managed to set it to 1, thats okay). But the MAX value has to be 10 (years). If 0 0=> error.

How can I ad this to the thingsblow??
"SeekBli" = become Equal to "Fasit", when changing "SeekEndre"


---
Option Explicit

Private Sub Worksheet_Calculate()
CheckGoalSeek
End Sub

Private Sub CheckGoalSeek()
Static isWorking As Boolean

With Ark11
If Round(.Range("SeekBli").Value, 6) <> 0 And Not isWorking Then
isWorking = True
.Range("SeekEndre").Value = 1
.Range("SeekBli").GoalSeek Goal:=Range("Fasit"), ChangingCell:=.Range("SeekEndre")
isWorking = False
End If
End With
End Sub
---

I'm still running on Office 2013/VBA 7.1. Office is on Norwegian.. And for some reason a lot of the VBA examples/codes don't work in my VBA.. Looks like it either have another name, or the examples is made on older systemes??..

Any suggestions?

Regards,
Kjetil
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Too difficult? ;) I dont think so for You experts ;)

As mentioned - Im not a prgrammer, I'm a banker. But something that say that the Goal Seek only tries <0 to 10] would be great.
 
Upvote 0

Forum statistics

Threads
1,223,954
Messages
6,175,600
Members
452,658
Latest member
GStorm

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top