drewbsking
New Member
- Joined
- Nov 3, 2011
- Messages
- 34
Beginner here trying to get goal seek to work for my needs.
I would like the goal to be a var because it changes based on a pipe size which correlates to a specific slope to be used in the goal seek. Can this be done?
The code below does not work. But it was what I was thinking.
I would like the goal to be a var because it changes based on a pipe size which correlates to a specific slope to be used in the goal seek. Can this be done?
The code below does not work. But it was what I was thinking.
Code:
Sub PipeGoalSeek()
Dim Slope As Integer
Slope = VLookup(Range("AK" & ActiveCell.Row), PipeArray, 5, False)
Range("BX" & ActiveCell.Row).Goalseek Goal:=Slope, ChangingCell:=Range("AY" & ActiveCell.Row)
'Can I put the value that would go into Range("AY" & ActiveCell.Row) into another varibile (say **result**) to be placed into a mround function like below?
Range("AY" & ActiveCell.Row) = "=Mround(**result**,0.05)"
End Sub
Last edited: