Hi Everyone,
I am trying to set up 7 buttons on a sheet which when each are clicked would change the value of one cell on a different sheet to a certain value.
here is my attempt at trying to do this:
I have each button in a cell on sheet 3. Here is a screen shot of it:

I was thinking, for example, if I clicked on the button L3, that cell A3 would then become active, and make the IF Else statements would work... well, surprise surprise, they didn't.... sigh.
I know my feeble attempt at writing the above macro is nowhere near correct.. but I tried.. and I'm learning.. but it's frustrating.
Now I just need to know what exactly I did wrong. Can someone help and fix my errors and set me on the right path... thanks for any help.
Dave
I am trying to set up 7 buttons on a sheet which when each are clicked would change the value of one cell on a different sheet to a certain value.
here is my attempt at trying to do this:
Code:
Sub set_LX()
If ActiveCell.Value = "A3" Then
Worksheets("Predictions").Range("C6").Value = 3
ElseIf ActiveCell.Value = "C3" Then
Worksheets("Predictions").Range("C6").Value = 4
ElseIf ActiveCell.Value = "E3" Then
Worksheets("Predictions").Range("C6").Value = 5
ElseIf ActiveCell.Value = "G3" Then
Worksheets("Predictions").Range("C6").Value = 6
ElseIf ActiveCell.Value = "I3" Then
Worksheets("Predictions").Range("C6").Value = 7
ElseIf ActiveCell.Value = "K3" Then
Worksheets("Predictions").Range("C6").Value = 8
ElseIf ActiveCell.Value = "M3" Then
Worksheets("Predictions").Range("C6").Value = 9
End If
End Sub
I have each button in a cell on sheet 3. Here is a screen shot of it:
I was thinking, for example, if I clicked on the button L3, that cell A3 would then become active, and make the IF Else statements would work... well, surprise surprise, they didn't.... sigh.
I know my feeble attempt at writing the above macro is nowhere near correct.. but I tried.. and I'm learning.. but it's frustrating.
Now I just need to know what exactly I did wrong. Can someone help and fix my errors and set me on the right path... thanks for any help.
Dave