Hi all,
I am beginner in Excel VBA. Before posting this thread I have researched many similar posts but none of the suggestions solved my problem. I am getting compile error. The solver is checked in the reference. The workbook is saved under a new name. Still getting the error for the following piece of code:
Private Sub CommandButton1_Click()
Dim Area As Double, Radius As Double, Perimeter As Double, Diameter As Double
Area = Range("D11").Value
Radius = SQRT(Area / Pi())
Perimeter = 2 * Pi() * Radius
Diameter = 2 * Radius
Range("D13").Value = Perimeter
Range("D15").Value = Diameter
Range("D17").Value = Radius
End Sub
The debugger displays that it does not know (not defined )Pi() and SQRT(). I appreciate your help
I am beginner in Excel VBA. Before posting this thread I have researched many similar posts but none of the suggestions solved my problem. I am getting compile error. The solver is checked in the reference. The workbook is saved under a new name. Still getting the error for the following piece of code:
Private Sub CommandButton1_Click()
Dim Area As Double, Radius As Double, Perimeter As Double, Diameter As Double
Area = Range("D11").Value
Radius = SQRT(Area / Pi())
Perimeter = 2 * Pi() * Radius
Diameter = 2 * Radius
Range("D13").Value = Perimeter
Range("D15").Value = Diameter
Range("D17").Value = Radius
End Sub
The debugger displays that it does not know (not defined )Pi() and SQRT(). I appreciate your help