PDA

View Full Version : How to deal with formatting when the width of a column depends on the row?



jungix
09-14-2006, 06:08 AM
Hello,

I'm doing multiple tables in an Excel sheet and I need quite precise width for the columns.

The issue is that I need different widths for my columns in according to the rows (for my first 3 pages I need certain widths for my columns to fit the data and in the following pages I need different widths (the data has not necessarily the same size).

The only way I've come up yet is to set the width of all cells to a fixed and small number (e.g. 5pts) and then merge as many cells as needed for my data. But that would not be very nice and would only allow widths which are a multiple of 5.

Is there a nice/ more convenient way to do this instead?

Thx

Jungix

Bob Phillips
09-14-2006, 06:21 AM
Why not Autofit them?

jungix
09-14-2006, 06:41 AM
I can't. I probably wasn't clear enough. For my 1st table (row 10-20) column B must be small (80pts) because the data in it is short.

Further in the document, column B must be larger (200pts) because the data is larger.

If I use Autofit the larger of the whole column will be 200 and then the table first table (rows 10-19) will be too large for the sheet and be cut.

Is this clearer?

Bob Phillips
09-14-2006, 06:45 AM
I see what you mean, but you can't have a variable width column, so you are stuck with merge (yuk!), or Centre Selection Acroos Columns in Cells>Format>Alignment.

mdmackillop
09-14-2006, 08:49 AM
If it's for presentation/printing, you could use Edit/Paste Picture Link to copy your data from another location.

jungix
09-14-2006, 11:31 AM
Nice idea, but it is possible to do it in a macro? I would have to do this for many files and can't afford to do it by hand for every file.

mdmackillop
09-14-2006, 11:58 AM
If you show us a sample workbook incorporating this I'm sure we can come up with something to try. It depends upon the consistency of your requirements.