Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Code to adjust column width

I am not a programmer but that doesnt seem to take into account the values in
row 8.
It will come in handy for something else though.

Cheers
Primed

"Rick Rothstein" wrote:

Why not let VB figure it out for you...

Columns("E:AI").AutoFit

--
Rick (MVP - Excel)



"primed" wrote in message
...
Hi,

Can anyone help with code to do the following:

Row E8:AI8 - each cell contains a value 0 to 100, generally a value of 1
to
20. The total of the row is maximum 100.
I would like to adjust the width of the column based on the values for
each
column.
The minimum width would need to be 6 so text is still readable.

Thanks in advance

Primed


.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Code to adjust column width

I'm not sure why you say that... the code line I posted sizes each column in
the range to the contents of the widest value in the column (which, unless I
completely misunderstood what you were asking for, I believe is what your
initial posting was suggesting you wanted to do). If you didn't already do
so, give it a try and see how it works.

--
Rick (MVP - Excel)



"primed" wrote in message
...
I am not a programmer but that doesnt seem to take into account the values
in
row 8.
It will come in handy for something else though.

Cheers
Primed

"Rick Rothstein" wrote:

Why not let VB figure it out for you...

Columns("E:AI").AutoFit

--
Rick (MVP - Excel)



"primed" wrote in message
...
Hi,

Can anyone help with code to do the following:

Row E8:AI8 - each cell contains a value 0 to 100, generally a value of
1
to
20. The total of the row is maximum 100.
I would like to adjust the width of the column based on the values for
each
column.
The minimum width would need to be 6 so text is still readable.

Thanks in advance

Primed


.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Code to adjust column width

Hi Rick,

Probably my poor communication skills are the issue. Columns E to AI need to
be resized based on values in row 8 only. Other rows contain data that needs
to be ignored.

Your formula seems to resize the columns based on the value in all the rows.

Regards
Primed

"Rick Rothstein" wrote:

I'm not sure why you say that... the code line I posted sizes each column in
the range to the contents of the widest value in the column (which, unless I
completely misunderstood what you were asking for, I believe is what your
initial posting was suggesting you wanted to do). If you didn't already do
so, give it a try and see how it works.

--
Rick (MVP - Excel)



"primed" wrote in message
...
I am not a programmer but that doesnt seem to take into account the values
in
row 8.
It will come in handy for something else though.

Cheers
Primed

"Rick Rothstein" wrote:

Why not let VB figure it out for you...

Columns("E:AI").AutoFit

--
Rick (MVP - Excel)



"primed" wrote in message
...
Hi,

Can anyone help with code to do the following:

Row E8:AI8 - each cell contains a value 0 to 100, generally a value of
1
to
20. The total of the row is maximum 100.
I would like to adjust the width of the column based on the values for
each
column.
The minimum width would need to be 6 so text is still readable.

Thanks in advance

Primed

.

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Code to adjust column width

Ah, I missed the Row 8 part. Give this a try then...

Range("E8:AI8").Columns.AutoFit

--
Rick (MVP - Excel)



"primed" wrote in message
...
Hi Rick,

Probably my poor communication skills are the issue. Columns E to AI need
to
be resized based on values in row 8 only. Other rows contain data that
needs
to be ignored.

Your formula seems to resize the columns based on the value in all the
rows.

Regards
Primed

"Rick Rothstein" wrote:

I'm not sure why you say that... the code line I posted sizes each column
in
the range to the contents of the widest value in the column (which,
unless I
completely misunderstood what you were asking for, I believe is what your
initial posting was suggesting you wanted to do). If you didn't already
do
so, give it a try and see how it works.

--
Rick (MVP - Excel)



"primed" wrote in message
...
I am not a programmer but that doesnt seem to take into account the
values
in
row 8.
It will come in handy for something else though.

Cheers
Primed

"Rick Rothstein" wrote:

Why not let VB figure it out for you...

Columns("E:AI").AutoFit

--
Rick (MVP - Excel)



"primed" wrote in message
...
Hi,

Can anyone help with code to do the following:

Row E8:AI8 - each cell contains a value 0 to 100, generally a value
of
1
to
20. The total of the row is maximum 100.
I would like to adjust the width of the column based on the values
for
each
column.
The minimum width would need to be 6 so text is still readable.

Thanks in advance

Primed

.

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Column Width: cannot adjust falcios Excel Discussion (Misc queries) 1 November 3rd 07 02:49 PM
column width will not adjust Bold, Underling and Italics errors Excel Worksheet Functions 1 October 22nd 07 10:51 PM
Adjust column width tlee Excel Discussion (Misc queries) 2 May 4th 06 11:58 PM
Adjust Column Width? CDAK Excel Discussion (Misc queries) 0 June 16th 05 10:26 PM
Using Code to Adjust Specific Column Width Nigel Bennett Excel Programming 4 March 9th 05 06:11 AM


All times are GMT +1. The time now is 01:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"