VBA Excel Get the count of rows and columns

' Used Range for sheet1 as an example
MsgBox Sheet1.UsedRange.Rows.Count
MsgBox Sheet1.UsedRange.Columns.Count


' Used Range for a specific sheet
MsgBox Sheets("Customers").UsedRange.Rows.Count
MsgBox Sheets("Customers").UsedRange.Columns.Count

Analytics