|
不需要字典的
- Sub Test()
- Dim lngAreas As Long, lngID As Long
- Dim lngRow_Start As Long, lngRow_Count As Long
- Dim lngR As Long
- Dim strResult As String, arrRowID As Variant
-
- ReDim arrRowID(1 To Rows.Count) As String
- lngAreas = Selection.Areas.Count
- For lngID = 1 To lngAreas
- lngRow_Start = Selection.Areas(lngID).Row
- lngRow_Count = Selection.Areas(lngID).Rows.Count
- For lngR = 0 To lngRow_Count - 1
- arrRowID(lngRow_Start + lngR) = "," & lngRow_Start + lngR
- Next
- Next
- strResult = Mid(Join(arrRowID, ""), 2)
- MsgBox "当前选择区域的行号为:" & strResult
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|