Mega Code Archive
Categories
/
VisualBasic Script
/
Excel
Returns a count of the number of rows in a selection
Sub CountRows() Dim myCount As Integer myCount = Selection.Rows.Count MsgBox "This selection contains " & myCount & " row(s)", vbInformation, "Count Rows" End Sub