Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Columnwidth in cm?

Is it possible to set the columnwidth in cm., instead of 'default chars'???


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Columnwidth in cm?

Something like this might work:

Sub Macro1()
Dim a As Double, b As Double, c As Double, d As Double
'
a = Columns("A:A").ColumnWidth ' Width in "standard" characters
b = Columns("A:A").Width ' Width in points (1/72 inch) - read only
c = b / a ' Number of points per "standard" character
width
d = 2.54 * b / 72# ' Width in cm
MsgBox ("Chars = " & a & Chr(10) & "Points = " & b & Chr(10) & "cm = " &
d)
'
' Set the column width to 5.5 cm:
'
Columns("A:A").ColumnWidth = 5.5 / d * a
'
End Sub

Eric
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Columnwidth in cm?

If you want to use VBA to set height and width in mm.

Ole Erlandson has code for setting row and column dimensions.

http://www.erlandsendata.no/english/...vbawssetrowcol


Gord Dibben Excel MVP

On Wed, 24 Sep 2008 17:49:29 +0200, "Charlotte E." <@ wrote:

Is it possible to set the columnwidth in cm., instead of 'default chars'???


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Columnwidth in cm?

Thanks to both of you - I'll look into your suggestions ...


Charlotte E. wrote:
Is it possible to set the columnwidth in cm., instead of 'default
chars'???



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
Columnwidth Jean-Paul Excel Discussion (Misc queries) 1 November 24th 09 02:21 PM
ColumnWidth abhimanyu Excel Programming 1 November 10th 06 01:14 PM
ColumnWidth Dwight[_4_] Excel Programming 2 July 14th 04 08:22 PM
Columnwidth changes-Event Tom Excel Programming 3 February 16th 04 03:36 PM
Selection.ColumnWidth Ron McCormick[_2_] Excel Programming 2 December 29th 03 11:41 AM


All times are GMT +1. The time now is 08:47 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"