I am trying to write a routine that takes a named range, rInput, which is made of merged cells spanning an unknown number of columns, but always in only a single row.
The purpose of the routine is to make the row height of "rInput" adjust to fit the text in "rInput" so that all text is visible regardless of how many lines it takes up inside of "rInput".
The routine will do the following:
1) unmerge "rInput"
2) determine how many columns were unmerged
3) determine the width of each column
4) make the width of the first cell equal the sum of all the widths so that the first cell now takes up the same width as "rInput" did originally
5) make text in first cell wrap, left align, top align, and AUTO-FIT ROW HEIGHT --this is the row height we'll want for the reconstituted merged range
6) resize column width of first cell to its original width --but keep row height unchanged from step 5 above
7) merge cells again keeping text wrap and alignment --now we have the original merged range "rInput" but with the appropriate row height to fit all the text in it.
I think I can write all the code for this if I could only figure out how to determine the number of columns in rInput. Is there a way to do this?