Friday, 28 September 2012

Excel VBA Macro To Count No.of All Rows and Columns In a Active Sheet

Excel VBA Macro To Count No.of All Rows and Columns In a Active Sheet

Sub CountAllRowsCols()
Dim X As Long
Dim Y As Integer


X = ActiveWorkbook.ActiveSheet.Rows.Count
Y = ActiveWorkbook.ActiveSheet.Columns.Count

MsgBox "The Total No.of Rows= " & X & " :: " & "The Total No.of Columns= " & Y

End Sub

Thanks.,
TPR

No comments:

Post a Comment

Follow Me by Email

ExcelKingdom-Popular Posts

ExcelKingdom-Random Posts