Private Sub CommandButton1_Click()

    Dim 선택범위 As Range
    Dim 합계 As Double
    
    On Error Resume Next
        Set 선택범위 = Range(RefEdit1.Text)
        
        If Err.Number <> 0 Then Exit Sub
    On Error GoTo 0
    
    합계 = WorksheetFunction.Sum(선택범위)
    
    Label2.Caption = "합계 : " & Format(합계, "#,###")
    
    RefEdit1.SetFocus
    
End Sub