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
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