Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
find largest column width and ...
Hello
i would like to find the largest column width in a range e.g. "A1:A20" and then set all the columns of this range to this largest width. how can i do that? Thanx. Submitted via EggHeadCafe - Software Developer Portal of Choice Crypto Obfuscator for .NET - Product Review http://www.eggheadcafe.com/tutorials...or-for-ne.aspx |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
find largest column width and ...
Try some code like
Sub AAA() Dim MaxWidth As Double Dim R As Range Dim RR As Range Set RR = Range("A1:K10") For Each R In RR If R.ColumnWidth MaxWidth Then MaxWidth = R.ColumnWidth End If Next R RR.EntireColumn.ColumnWidth = MaxWidth End Sub Cordially, Chip Pearson Microsoft MVP 1998 - 2010 Pearson Software Consulting, LLC www.cpearson.com [email on web site] On Sat, 08 May 2010 06:47:51 -0700, S S wrote: Hello i would like to find the largest column width in a range e.g. "A1:A20" and then set all the columns of this range to this largest width. how can i do that? Thanx. Submitted via EggHeadCafe - Software Developer Portal of Choice Crypto Obfuscator for .NET - Product Review http://www.eggheadcafe.com/tutorials/aspnet/bf15c41b-6510-403e-9af8-f5fd987fafb1/crypto-obfuscator-for-ne.aspx |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
find largest column width and ...
Your posted range has only one column. For columns A-Z, try:
Sub demo() Dim cw As Integer, i As Integer, wdth As Integer cv = 0 For i = 1 To 26 wdth = Columns(i).ColumnWidth If wdth cw Then cw = wdth End If Next Columns("A:Z").ColumnWidth = cw End Sub -- Gary''s Student - gsnu201002 "S S" wrote: Hello i would like to find the largest column width in a range e.g. "A1:A20" and then set all the columns of this range to this largest width. how can i do that? Thanx. Submitted via EggHeadCafe - Software Developer Portal of Choice Crypto Obfuscator for .NET - Product Review http://www.eggheadcafe.com/tutorials...or-for-ne.aspx . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
find largest column width and ...
Hello,
with Excel 2007 you can frame in the region and click: Format Autofit column width Hth Gabor Sebo "S S" wrote in message ... Hello i would like to find the largest column width in a range e.g. "A1:A20" and then set all the columns of this range to this largest width. how can i do that? Thanx. Submitted via EggHeadCafe - Software Developer Portal of Choice Crypto Obfuscator for .NET - Product Review http://www.eggheadcafe.com/tutorials...or-for-ne.aspx |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
find largest column width and ...
How can you do that?
With great difficulty. A1:A20 is a single column. Gord Dibben MS Excel MVP On Sat, 08 May 2010 06:47:51 -0700, S S wrote: Hello i would like to find the largest column width in a range e.g. "A1:A20" and then set all the columns of this range to this largest width. how can i do that? Thanx. Submitted via EggHeadCafe - Software Developer Portal of Choice Crypto Obfuscator for .NET - Product Review http://www.eggheadcafe.com/tutorials...or-for-ne.aspx |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to find the largest value in a column? | Excel Discussion (Misc queries) | |||
find the largest value in column, put in a cell | Excel Worksheet Functions | |||
Find Largest and Return Column Name | Excel Worksheet Functions | |||
find the largest value in column, put in a cell | Excel Discussion (Misc queries) | |||
How do I find the largest in a column | Excel Worksheet Functions |