Hello all,
Let me explain what I pretend:
I have plotted a chart in excel for a product anual sales and forecasts. I've created a drop list to select the product upon which the graph is updated. That works perfectly.
But now I want to put a spin button next to the graph that changes a parameter in forecast's formula.
Depending on the chosen product, the spin button should change the respective parameter value for that product - which is also the linked cell for the button.
I've come with a simple code and put it in the Spin Button object, but it doesn't work (note that I'm not a vba expert....)
Code:
Private Sub SpinButton1_Change()
If Range("G10").Value = "PRODUCT A" Then
SpinButton1.LinkedCell = Range("P105")
End If
If Range("G10").Value = "PRODUCT B" Then
SpinButton1.LinkedCell = Range("AG105")
End If
If Range("G10").Value = "PRODUCT C" Then
SpinButton1.LinkedCell = Range("AX105")
End If
If Range("G10").Value = "PRODUCT D" Then
SpinButton1.LinkedCell = Range("BO105")
End If
End Sub
What am I doing wrong? Thanks for your help!
Bookmarks