Hello Paul,
I rewrote it like this and it worked:
Sub Rectangle()
'define the variables
Dim circumfence As Double
Dim area As Double
Dim diagonal As Double
Dim l As Integer
Dim w As Integer
'select where the variables are
l = Range("B1").Value
w = Range("B2").Value
'defining the formulas
If Range("B3").Value = 1 Then
circumfence = (2 * l) + (2 * w)
MsgBox "The Circumfence is:" & circumfence
ElseIf Range("B3").Value = 2 Then
area = l * w
MsgBox "The area is:" & area
ElseIf Range("B3").Value = 3 Then
diagonal = Sqr(l ^ 2 + w ^ 2)
MsgBox "The diagonal is:" & diagonal
'If you dont select 1,2 or 3
Else
MsgBox "Please choose the right calculation", vbCritical, "Warning"
End If
End Sub