Amit Punia
Member
I inserted an activeX Box and went inside that to see the coding window(Double click on the box). It showed me this coding -
I changed the coding and wrote Function instead of Private Sub -
Now when I'm trying to click on the ActiveX Button, it's not showing any output. How to assign(is the wrong term and only used in Sub Procedure) a macros to this button?
Code:
Private Sub CommandButton1_Click()
End Sub
I changed the coding and wrote Function instead of Private Sub -
Code:
Function CommandButton1_Click(L As Double, W As Double) As Double
L = InputBox("Enter Length", "Enter A Value")
W = InputBox("Enter Width", "Enter A Value")
Area = L * W
ActiveSheet.Range("F8").Value = Area
End Function
Now when I'm trying to click on the ActiveX Button, it's not showing any output. How to assign(is the wrong term and only used in Sub Procedure) a macros to this button?
Last edited by a moderator: