Is the current selection a Range
Sub EnterAvg() If TypeName(Selection) <> "Range" Then Exit Sub End Sub