Thread: Vba goal seek
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
mangesh_yadav[_262_] mangesh_yadav[_262_] is offline
external usenet poster
 
Posts: 1
Default Vba goal seek


Try this:

Dim AperC As Double
Dim BperD As Range

AperC = Range("A1") ^ 2 / 10
'Set BperD = Range("B1") ^ 3 + Range("C1")
Range("D1") = "=B1^3+C1"
Set BperD = Range("D1")


On Error GoTo TheEnd
Application.EnableEvents = False

Do Until AperC = BperD
BperD.GoalSeek Goal:=AperC, ChangingCell:=Range("C1")
Loop

TheEnd:
Application.EnableEvents = True



Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=376747