I have a worksheet named "Main" that I would like to have an InputBox to pop up when a radio button is selected; (Option Button 3 with value = 1 in cell A311), and have the value of the InputBox placed into cell R2. I have placed the following code directly into the objects sheet but can get it to only run when I assign the macro directly to the radio button. I would like to set it up as a private sub and run based just on the selection of the radio button without having to assign the button a macro. Please help!
Code:
Sub Pumped_WS()
Dim userinput As String
Set pumped = ActiveSheet.Range("A311")
Set ws = ActiveSheet.Range("R2")
If pumped.Value = 1 Then userinput = Application.InputBox("Please enter elevation for the pumping water surface!")
ws.Value = userinput
End Sub