How many rows did I select in Excel?
Is there an easy way to count the amount of rows I selected in a sheet?
I might be completely overlooking this but I don't see a counter or anything anywhere at all. The only counters I see is average, sum and cell count.
32 Answers
My approach is little different, and I would like to suggest you, a VBA Macro using Woksheet Selection Change Event to count selected Rows, which actually automates the Count.
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim i As Long, lngAreas, lngRows As Long lngAreas = Selection.Areas.Count lngRows = 0 For i = 1 To lngAreas lngRows = lngRows + Selection.Areas(i).Rows.Count Next i MsgBox "There are " & lngRows & " rows selected"
End SubHow it works:
- Press ALT+F11 to open VB Editor.
- Copy & Paste this Code & from File Menu click Close & Return to Microsoft Excel.
- Save the WB as Macro enabled *.xlsm.
- Select Cell/Rows, you get count through Message Box.
N.B.
This Macro will Count Row/Rows, as soon you select Row/Rows, using Mouse or Keyboard.
2No. I don't think there would be anything built in.
However you can create a short macro and assign a hotkey to call it quickly:
Sub DisplayRowCount() MsgBox Selection.Rows.Count & " rows in the selection"
End Sub 2