Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code to adjust column width
Cheers,
Worked great. I modified slightly. Sub ColumnAdjust() Set Rng = Range("E8:AI8") For Each cell In Rng If cell.Value = 1 Then cell.ColumnWidth = cell.Value * 6 Else cell.ColumnWidth = 0 End If Next End Sub "Per Jessen" wrote: Hi Primed This should do it: Sub ColumnAdjust() Set Rng = Range("E8:AI8") For Each cell In Rng If cell.Value = 6 Then cell.ColumnWidth = cell.Value Else cell.ColumnWidth = 6 End If Next End Sub Regards, Per "primed" skrev i meddelelsen ... 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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Code to adjust column width | Excel Programming | |||
Column Width: cannot adjust | Excel Discussion (Misc queries) | |||
column width will not adjust | Excel Worksheet Functions | |||
Adjust column width | Excel Discussion (Misc queries) | |||
Using Code to Adjust Specific Column Width | Excel Programming |