Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 300
Default Getting column width of a hidden column?

Can my VBA code obtain the unhidden width of a hidden column? In order for
my print range to include all of a size-frozen text box, I have to find how
many visible columns cover it. This is no problem, but I have hard coded in
the macro the minimum width needed. I'd rather sum up the widths of A to H
(what the textbox spans if all columns are unhidden) and have the width
base be dynamic.

Don <www.donwiss.com (e-mail link at home page bottom).
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Getting column width of a hidden column?

Hi Don,

One way

Dim cWidth As Double
Dim i As Long

For i = 1 To 8
If Columns(i).Hidden Then
Columns(i).Hidden = False
cWidth = cWidth + Columns(i).ColumnWidth
Columns(i).Hidden = True
Else
cWidth = cWidth + Columns(i).ColumnWidth
End If
Next i

MsgBox cWidth


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Don Wiss" wrote in message
...
Can my VBA code obtain the unhidden width of a hidden column? In order for
my print range to include all of a size-frozen text box, I have to find

how
many visible columns cover it. This is no problem, but I have hard coded

in
the macro the minimum width needed. I'd rather sum up the widths of A to H
(what the textbox spans if all columns are unhidden) and have the width
base be dynamic.

Don <www.donwiss.com (e-mail link at home page bottom).



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
how do I create multiple column width in the same column in excel Vish Excel Discussion (Misc queries) 9 November 3rd 06 11:49 PM
How to make cell width different than the column width it lies in John Excel Discussion (Misc queries) 2 September 11th 06 10:41 PM
Column Auto Width and Hidden Rows KWCounter Excel Discussion (Misc queries) 1 May 20th 05 12:59 AM
Change the width of a single column in a column chart Dave Charts and Charting in Excel 2 December 13th 04 07:25 PM


All times are GMT +1. The time now is 03:33 AM.

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"