Dim housetypes, elements, NumRowsElements, NumColumnsHousetypes
elements = Range("c10:c19")
housetypes = Range("d9:n9")
NumRowsElements = UBound(elements)
NumColumnsHousetypes = UBound(housetypes)
MsgBox ("NumRowsElements is " & NumRowsElements & " NumColumnsHousetypes is " & NumColumnsHousetypes)
I'm not sure why the above code will show me the correct number of row headers (C10 to C19) but not return the correct number of column headers (D9 to N9)?