ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Working with cells and images (https://www.excelbanter.com/excel-programming/357692-working-cells-images.html)

alenhart[_2_]

Working with cells and images
 
Okay, I have looked everywhere but cannot find the topic that initially
brought me he automatically centering an image over a single cell.
I have hundreds of images in a spreadsheet, each "floating" over a
specific cell, one per row, etc. What I need to do is center each image
over its cell. I have gotten past the initial stage of selecting all
the images, but I am stuck now.

Any suggestions??
thank you.


K Dales[_2_]

Working with cells and images
 
Images are in Shape objects and each Shape has a .TopLeftCell if you need to
find what cell it is "in" (at least the top left corner). Then they also
have a .Top and .Left, to set their precise location, and a .Width and
..Height, to control their size.

Cells (or any Range) also have a .Top, .Left, .Width, and .Height. So you
can use these to figure the proper values for the image or vice-versa. It
depends on whether you want to change the size of the picture to fit the cell
or the size of the cell to fit the picture.

--
- K Dales


"alenhart" wrote:

Okay, I have looked everywhere but cannot find the topic that initially
brought me he automatically centering an image over a single cell.
I have hundreds of images in a spreadsheet, each "floating" over a
specific cell, one per row, etc. What I need to do is center each image
over its cell. I have gotten past the initial stage of selecting all
the images, but I am stuck now.

Any suggestions??
thank you.



alenhart[_2_]

Working with cells and images
 
I understand what you mean by each shape having a space it is in, and
each cell having those same confines, but I don't understand how to
relate the two.

For example I have an image... call it giovanni-particolare.jpg hanging
out on top of B9. now I have already scaled all my images to be the
same height (80 pixels), and adjusted my row height to be constant (84
pixels), so I don't want to change the size of anything. how do I say I
want 2 pixels from the top?



All times are GMT +1. The time now is 06:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com