Greetings,
I have a code linked to a command button and I get get the Error Handling to work properly... Here is the code I have so far;
Private Sub CommandButton3_Click()
Dim rng As Range
Set rng = ActiveSheet.AutoFilter.Range
On Error GoTo ErrMsg
MsgBox rng.Columns(1). _
SpecialCells(xlCellTypeVisible).Count - 1 _
& " of " & rng _
.Rows.Count - 1 & " Records"
ErrMsg:
MsgBox ("Type in your message here."), , "MESSAGE TITLE"
End Sub
The error usually occurs at "Set rng = ActiveSheet.AutoFilter.Range" and only occurs when the active cell is not in the active table.
I have a code linked to a command button and I get get the Error Handling to work properly... Here is the code I have so far;
Private Sub CommandButton3_Click()
Dim rng As Range
Set rng = ActiveSheet.AutoFilter.Range
On Error GoTo ErrMsg
MsgBox rng.Columns(1). _
SpecialCells(xlCellTypeVisible).Count - 1 _
& " of " & rng _
.Rows.Count - 1 & " Records"
ErrMsg:
MsgBox ("Type in your message here."), , "MESSAGE TITLE"
End Sub
The error usually occurs at "Set rng = ActiveSheet.AutoFilter.Range" and only occurs when the active cell is not in the active table.