Private Sub CommandButton1_Click()
Dim rng1 As Range
On Error Resume Next
Set rng1 = Range(RefEdit1)
If Not rng1 Is Nothing Then
MsgBox "输入单元格区域正确"
rng1.Interior.ColorIndex = 15
Else
MsgBox "输入单元格区域不正确"
End If
End Sub
Private Sub CommandButton1_Click()
Dim rng1 As Range
On Error Resume Next
Set rng1 = Range(RefEdit1)
If Not rng1 Is Nothing Then
MsgBox "输入单元格区域正确"
rng1.Interior.ColorIndex = 15
Else
MsgBox "输入单元格区域不正确"
End If
End Sub