Mikericson, I have corrected the typos in my code (Ndim=Ndx; nd = NDim(x)). Still It doesn't do what I would like to. Nesting vba function will greatly improve readability of my code. Otherwise I have to use very long function with many parts.
-ald() creates one dimensional array to which string length 'ld' of the longest string from array 'ar2' column is stored. (maximum length for each column)
Bookmarks