fredlo2010
06-26-2012, 07:43 PM
Hi guys,
This something I have always wanted to do and I think I can do it now with VBA.
I have this sheet with some data and formulas. What I want is to update my formulas as i enter values to fit my needs.
To make it simpler if i have a price for apples and I want to know whats the price for 15 apples or how many apples I can buy with $ 15.00.
I could use the regular Goal seek but my formulas contain several If and they are a little complicated. It is not just simple multiplication.
I found this piece of code online and it looks very promising. But i cannot make it fit my needs. Maybe I am just trying the wrong things, or maybe this is extremely complicated.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Row = 6 And Target.Column = 2 Then
Target.Value = vbNullString
Range("B5").FormulaR1C1 = "=r[1]c/r[-1]c"
End If
End Sub
I made a small dummy sheet to get some ideas.
Thanks a lot guys.
8331
This something I have always wanted to do and I think I can do it now with VBA.
I have this sheet with some data and formulas. What I want is to update my formulas as i enter values to fit my needs.
To make it simpler if i have a price for apples and I want to know whats the price for 15 apples or how many apples I can buy with $ 15.00.
I could use the regular Goal seek but my formulas contain several If and they are a little complicated. It is not just simple multiplication.
I found this piece of code online and it looks very promising. But i cannot make it fit my needs. Maybe I am just trying the wrong things, or maybe this is extremely complicated.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Row = 6 And Target.Column = 2 Then
Target.Value = vbNullString
Range("B5").FormulaR1C1 = "=r[1]c/r[-1]c"
End If
End Sub
I made a small dummy sheet to get some ideas.
Thanks a lot guys.
8331