Thread: GoalSeek in VBA
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
[email protected] alundlarsen@gmail.com is offline
external usenet poster
 
Posts: 1
Default 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