View Full Version : [Solved ] Formatting Crosstab column width


Rx_
10-26-2010, 01:37 PM
Code is written to take Access / SQL DB data and create on-demand crosstab reports using Excel VBA.

When one of the filters are chosen, Excel helps the user by auto-fit the column width. The same effect if the user double clicked on the line between the columns (the line between A and B on the grid)

The data columns widths need to stay consistant for the user. Since the auto-fit adjust to the widest text in a column, adding a string XXXXX to the columns shown (see attachment image) brings the columns back to a standard every time the filter is clicked.

So the user doesn't see the XXXXXX, just turn the font to white.
Now they are hidden.

Another note: don't add text to the side or below the crosstab area.
When users expand a row or column, if the text is in the way, the crosstab will generate a message asking the user if they want to remove it.