LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 224
Default Size Picture to Cell

Is there a good way to size a picture to a cell?

Sizing the cell's width to the picture is no problem, and moving the
picture to the cell's location is no problem, but ColumnWidth is not
in points, and the Range or Column object's Width property, which is
in points, is read-only.

The question has been asked before, but...

I tried entering a "0" in a cell and autofitting it, since ColumnWidth
is based on the width of a single "0" in the normal font. But when I
check the ColumnWidth property, it wasn't exactly 1 as expected.
Instead, it was 1.29. Two zeroes ("00") had a ColumnWidth of 2.29.

Is the addition of the 0.29 to the 1 consistent, or does it depend on
various unpredictable factors?


Is there a better way of doing it than this:

1) Try changing the ColumnWidth property by increasingly larger
amounts until the minimum amount is found that actually changes the
width, because just trying to change it by 0.01 doesn't have any
effect. In a quick test just now, the minimum amount was 0.08, which
caused a change of 0.14, but obviously that depends on the normal font
and maybe other factors too.
2) Repeatedly change the ColumnWidth property by that minimum amount,
checking the resulting Width each time, until the desired Width is
reached.

Is there a better way?


Thanks,

Greg

 
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 move and size a picture with a cell but keep the aspect r Gidmark Excel Discussion (Misc queries) 2 July 2nd 09 12:31 PM
How to insert picture and automatically size to cell? ursa_nz Excel Worksheet Functions 1 August 22nd 05 03:29 AM
How to insert a picture that automatically sizes to size of cell? ursa_nz Excel Worksheet Functions 0 August 22nd 05 02:56 AM
copy charts & paste as picture, hide chart, size & place same picture as chart Gunnar Johansson Excel Programming 0 October 30th 04 01:22 AM
Picture the same size as a cell Nater[_2_] Excel Programming 2 August 11th 04 06:52 PM


All times are GMT +1. The time now is 02:24 PM.

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"