I need an efficient and preferably non-volatile worksheet function to count the columns in a supplied range. I am using e.g.
for a range that has only one row, or I guess I could have
for a range with multiple rows.
Obviously I could have a simple UDF like
Public Function ColCount(ByRef rngIn As Excel.Range) As Long
ColCount = rngIn.Columns.Count
to do this, but I'm looking for a worksheet function if possible.
Any better ideas than mine?