column widths

ajetrumpet

Banned
Local time
Today, 15:02
Joined
Jun 22, 2007
Messages
5,638
I wonder if there is a way in Excel to manipulate column widths more than once on a page, and apply those widths to only certain rows in the datasheet...I am looking to split the sheet in "sets" of rows and I would like to set different column widths for each "set" or "section" of rows.

Say, for example, data listed in Rows 10-20 need different column widths for A-H than the data in Rows 30-50 for A-H.

Ideas on this anyone??? Appreciate it...:)
 
I wonder if there is a way in Excel to manipulate column widths more than once on a page, and apply those widths to only certain rows in the datasheet...I am looking to split the sheet in "sets" of rows and I would like to set different column widths for each "set" or "section" of rows.

Say, for example, data listed in Rows 10-20 need different column widths for A-H than the data in Rows 30-50 for A-H.

Ideas on this anyone??? Appreciate it...:)

You mean row height ?
e.g. :- Rows("10:20").RowHeight = 19.5 :rolleyes:

If you actually mean different widths for different rows then the answer is no.
 
Yes, I mean different widths for different rows. The answer is no?? I am 99.99% sure there would be if I could code a module. There has to be...there is almost unlimited power with VBA for any program. All of the code that I know now is incredibly powerful, and I don't even know that much...most of it is for MS Access anyway. How much experience do you have with Basic??

I'm certainly not trying to insult you, but I would tend to think that the Key words set for Excel VB should be able to accomplish this somehow....
 
No you can't do what you want. If a column width is changed then that change affects all rows on the referenced worksheet. Try it yourself:

Code:
Sub col_width_test()

ThisWorkbook.Worksheets(1).Range("A1:A5").ColumnWidth = 25
ThisWorkbook.Worksheets(1).Range("A6:A10").ColumnWidth = 30

End Sub

When you try this out you will see it doesn't work.

The only way to have different sized cells within a single column is by merging cells:

Code:
Sub col_width_test()
ThisWorkbook.Worksheets(1).Range("A1:A5").ColumnWidth = 25
ThisWorkbook.Worksheets(1).Range("A6:B6").MergeCells = True
End Sub

And this method won't really work as from what you have written it would appear you will have data in adjacent cells and when you merge cells you lose the data from the cell(s) on the right.
 
Last edited:
Yes, I mean different widths for different rows. The answer is no?? I am 99.99% sure there would be if I could code a module. There has to be...there is almost unlimited power with VBA for any program. All of the code that I know now is incredibly powerful, and I don't even know that much...most of it is for MS Access anyway. How much experience do you have with Basic??

I'm certainly not trying to insult you, but I would tend to think that the Key words set for Excel VB should be able to accomplish this somehow....

Think about what you said here ... Think about how 'you' would store information that has to be grid tabulated and occupy 1 of 256x65k cells x however many sheets you have (even more from 2007) What you are looking for is a free form graphical layout with each area custom formatted with those formats not interfering with an ajoining area ... can you imagine the file size of such an object ? how would you store it ? there are no common rules about layout. You want to define individual widths per row but maybe the next guy wants indivual heights per column, put the two together and you haven't just got chaos you've got nothing, because to refer to any cell you would need to specify its address (okay you do that now) but you also have to tell a cell what ITS OWN ADDRESS is because you change a cell width and obliterate or create cells on a semi random basis, add to that that when you need to update cell AC144 you have to search a whole swathe of cells because you can't rely on row or column headers.
Think about doing this in word (in a single table) or even in HTML (or XTML) it just can't be done, at least not in ANY table arrangement that makes any logical and space saving sense I am aware of.
As chergh says your ony option is merged cells and they cause more problems than they are worth and anyone who works with Excel will tell you "Avoid them like the plague".
 
Sounds like you are trying to create a Word table in Excel. Doesn't work that way.

One possibility might be to spread out the arrangement so you have some blank columns except where you want the "extra wide". This would be an illusion, so not true varying column widths for each row. And it would defeat the purpose of the Excel grid and functions/capabilities.
________
Yamaha Psr-S500
 
Last edited:
If this is for display purposes, then why not set up section s on different worksheets, and then paste link pictures of each into either PPT or Word.
________
MIYOSHI PLANT (MAZDA) SPECIFICATIONS
 
Last edited:
Thanks for the thoughts everyone. I am getting the idea. I guess I would say now that this was a general question about a property. I don't do this stuff for a living, so I don't know everything if you know what I mean.

I have already used the illusion method Shades, I will just have to stick with that. No problems...
 

Users who are viewing this thread

Back
Top Bottom