Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
GoalSeek in VBA
When if running this code I get the following error, anyone who know
what the problem is? Error: "Method 'Range' of object '_Global' failed" Sub GoalSeekMacro() Source = Worksheets("Olie og gas").Cells(9, 15).Value ResultCell = "n9" Result = 20 Range(ResultCell).GoalSeek goal:=Result, ChangingCell:=Range(Source) End Sub |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
GoalSeek in VBA
Hi
Use below mentioned macro: Sub GoalSeekMacro() Dim rngS As Range Dim rngD As Range Set rngS = Range("O8") Set rngD = Range("N9") Result = 20 rngD.GoalSeek Goal:=Result, ChangingCell:=rngS End Sub " wrote: When if running this code I get the following error, anyone who know what the problem is? Error: "Method 'Range' of object '_Global' failed" Sub GoalSeekMacro() Source = Worksheets("Olie og gas").Cells(9, 15).Value ResultCell = "n9" Result = 20 Range(ResultCell).GoalSeek goal:=Result, ChangingCell:=Range(Source) End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Goalseek / Solver Target Value | Excel Worksheet Functions |