Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Total width of multiple columns

Is there a quick way of finding out the total width of several adjacent
columns?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Total width of multiple columns

Hi,

I'd be intrigued to understand why you need this but here's one way.

Call with =Col_Width()

Select a single row of cells and tap F9 to make it re-calculate

Function Col_Width() As Variant
Dim C As Range
Application.Volatile
If Selection.Rows.Count 1 Then Exit Function
For Each C In Selection
Col_Width = Col_Width + C.ColumnWidth
Next
End Function
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"ni an" wrote:

Is there a quick way of finding out the total width of several adjacent
columns?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Total width of multiple columns

Thanks Mike. I haven't tried this yet, but here's the reason I need it.

I have a number of spreadsheets that need to look good. One, for example,
is a booking form for a holiday venue. The form is divided into sections
which are outlined with borders in a grid format. To accommodate the
different types of data in the various sections, the form is made up of
several columns of varying widths, with different combinations of cells
merged on different rows.

Some of the sections are full page width and others are half width (two
sections side by side). It's obviously going to look much better if both
sides are of equal width, and I've built it like that, but sometimes I need
to tweak column widths to make the data fit, and then I have to get both
sides equal again. At the moment I check all the column widths and add them
up, but I'm looking for a quicker and less tedious way.

It would be great if I could merge all the columns on the left side of the
page, and all the columns on the right, on a row outside the print area, and
check the width of the merged cells whenever I needed to, but it doesn't work
like that: it only gives you the unmerged width of the first column in each
merged group.

I'll try your formula later and let you know if I have any problems with it.
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
Total width of selected columns? sarah Excel Discussion (Misc queries) 2 February 10th 09 03:16 PM
Total width of selected columns? sarah Excel Discussion (Misc queries) 2 February 10th 09 03:14 PM
Total width of several columns. Basher Bates Excel Worksheet Functions 2 April 17th 06 12:38 PM
total value relating to cell values in multiple columns! via135 Excel Discussion (Misc queries) 3 January 25th 06 06:43 PM
how can i find total width of the columns in a printing area ? EXCELL COLUMN WIDTH Excel Discussion (Misc queries) 1 May 24th 05 11:35 PM


All times are GMT +1. The time now is 10:24 AM.

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

About Us

"It's about Microsoft Excel"