Sub fff()Dim myrange As RangeDim SSet myrange = Range(Application.InputBox("请选择区域", "输入区域"))S = Application.Max(myrange)MsgBox SEnd Sub