Private Sub Hcalculate_Click()
Dim i As Long
On Error Resume Next
For i = 1 To 9
With Me.Controls("HQ" & i)
.Value = vbNullString
.Value = -Int(-CDbl(Me.Controls("HF" & i).Value) / CDbl(HCL.Value))
End With
Next i
On Error GoTo 0
End Sub
First, each of the HQx controls will be cleared, and then a calculation attempt will be made. If any of the HFx or HCL fields are empty, an error will occur that was "handled" with the On Error Resume Next command, which instructs you to ignore runtime errors.
Artik