Hi,

I would like to be able to autosize excel columns based on the max width required for a range of cells, rather than autosize them all.

i.e. all columns will be the same width - that of the cell with the most characters.

I have had some success in doing this in one worksheet, but would like to know a more general solution, which could be applied whenever I select a row or range of cells in a row.

My simple solution:

1) Find the maximum length of characters in the range ={max(len(A1:A99))}

2) set column width based on the above

3) Copy column width (paste special) based on the above.

If anybody has done this before (I can't believe they haven't) or knows of a simple vba solution, I'd love to hear from them.

Thanks in advance.

Mike

I would like to be able to autosize excel columns based on the max width required for a range of cells, rather than autosize them all.

i.e. all columns will be the same width - that of the cell with the most characters.

I have had some success in doing this in one worksheet, but would like to know a more general solution, which could be applied whenever I select a row or range of cells in a row.

My simple solution:

1) Find the maximum length of characters in the range ={max(len(A1:A99))}

2) set column width based on the above

3) Copy column width (paste special) based on the above.

If anybody has done this before (I can't believe they haven't) or knows of a simple vba solution, I'd love to hear from them.

Thanks in advance.

Mike

## Comment