Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim rows_count As Integer
Dim rows_id As Integer
Dim column_count As Integer
Dim column_id As Integer
column_count = Selection.Columns.Count ‘返回选择区域列数
rows_id = ActiveCell.Row ‘返回活动单元格的行号
rows_count = Selection.Rows.Count ‘返回选择区域的行数
column_id = ActiveCell.Column ‘返回活动单元格的列号
MsgBox rows_count
MsgBox column_count
MsgBox column_id
MsgBox rows_id
End Sub
原文地址:https://www.cnblogs.com/xwenwu/p/12090343.html
时间: 2024-10-18 03:47:18