VBA 选择使用区域 Sub Select_UsedRange() ActiveSheet.Range(ActiveSheet.Cells(1, 1), ActiveSheet.UsedRange).Select End Sub rc = .range("a1").CurrentRegion.Rows.Count cc = .range("a1").CurrentRegion.Columns.Count cc = .Range(.Cells(1, 1), .Used…
Private Sub Worksheet_SelectionChange(ByVal Target As Range) '可以直接sub(),不然选择就会触发vba 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 '返回选择区域列数 …