want image to define the cell size

C

Captain Canada

Hi, I'm new to this forum, but not to XL. I know how to paste an image (e.g.
jpg) into XL and have it occupy however many cells as determined by its pixel
resolution; what I'd *like* to do is paste an image into a cell and force the
cell (and hence row and column) to expand to accommodate the image's size.
There's probably some dumb formating trick that I'm missing ... Anybody's
help would be much appreciated! Thanks.
 
J

Joel

There is no way from the worksheet and it is tricky from VBA code. The
problem is the pcitures are not part of the worksheet cells. A picture sits
ontop of the cells and is independant of the cell locations.

Both cell and pictures are referenced to pixel locattions in the window.
they both havve properties : Left, Top, Height, Width. but you can't lock a
picture pixel location to a speadsheet pixel location. If you change the
width or height of the rows and columns, the picture doesn't move the cells
will move.
 
C

Captain Canada

Thanks, Joel, for your answer. I was hoping there'd be an easy way, but at
least I'll know not to keep banging my head against this wall. All my images
in this file are going to be the same size, so I can probably just define all
the rows to be the height of the image, and that will get the job done ...
hopefully.

Cheers,
John
_______________
 
C

Captain Canada

Hi Joel,

So, I didn't do what I wanted, but I found another way to get to where
I was going, which may be useful info. On the off chance a) it's useful, and
b) you didn't already know this, here's my attempt to give back :)

-I have a spreadsheet that has rows of data; each row represents one expt,
and also has an image of the end-product data trace, crucial to the dataset
-what I wanted was to be able to use filters to select only certain rows per
whatever criteria, including the image in that row
-I got around the sizing issue by simply identically sizing all imported
images via a macro, and defining all rows to be the right size for the
images' height (likewise for column width). So far, nothing clever.
-I then encountered the problem that most rows selected by a given filter
showed the correct corresponding image, *but not all*!! Very aggravating.
Made the whole exercise unreliable if we're looking at the wrong picture for
that expt
-it turns out that the filtered rows will only display their image if the
images are properly vertically stacked, e.g. one needs to stack them bottom
to top from the 1st row to the Nth. Once that was done, rows selected by
filtres correctly displayed their images, no monkey business

That's a lot of verbiage for something you probably already knew!

Cheers,
John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top