'本例中,统计的是第E列的数据,按需修改成你要的列号
'最大值 最小值类型是Double,可按需修改为你的类型
Private Sub CommandButton1_Click()
Dim iNum As Long, iMax As Double, iMin As Double
iMax = 100 '最大值 按需修改为你要的值
iMin = 95 '最小值 按需修改为你要的值
Dim Rng As Range, cel As Range
Set Rng = ActiveSheet.Range("E1:E" & ActiveSheet.UsedRange.Rows.Count).SpecialCells(xlCellTypeVisible)
For Each cel In Rng
If cel.Value <= iMax And cel.Value >= iMin Then iNum = iNum + 1
Next
MsgBox iNum
End Sub