试试这个代码吧:
Sub hangshu() MsgBox Selection.Rows.Count & "行"End Sub
Debug.Print Selection.Rows.Count打印选中区域行数