An Excel toolbox for data management
The aim of this page is to provide an overview of Excel functions that will surely help the user in his daily data management tasks. It's starts by considering the Excel sheet data as if it was a mini database. It's particularly useful when the amount of data is limited and when no sophisticated processing of the data is required.
A basic request : counting rows and colimns
In the case of an existing list stored in an Exel sheet, it's helpful to be able to gather the number of rows and the number of columns of this list.
For example in the case where, the user needs to monitor the total number of records of the excel sheet or in case the aim is to apply a some processing or transformation on a record by record basis.
Custom VBA function example: counting rows with rows_count
' ***************************************************
' Function : rows_count
' Object : return the number of rows of current selection or argument range
' Paramters :1 (optional)
' r : range(optional)
' version:0.01
'***************************************************
Function rows_count(r As Variant)
' Initialization and error management
res="#N/A"
On Error GoTo rows_count_fin
' Test if a argument was provided
If (IsNull(r) = False And IsError(r) = False) Then
Range(r).Select
End If
res = Selection.Rows.Count
rows_count_fin:
rows_count=res
Exit Function
End Function
' *********************END***************************