Inserting photo to a pre-determined size

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Inserting photo to a pre-determined size

Post by ABabeNChrist »

What I’m trying to achieve is being able to insert a photo into a selected cell. The photo must be a pre-determined size, the reason for this is the cell selection to be used to insert photo will be able to expand its height to accommodate additional photos if needed. I know I could just insert an additional row, but the problem there is too much info below that will be effect by inserting a row. I attached a workbook that may better explain.
Sample Photo.xlsm
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78524
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Inserting photo to a pre-determined size

Post by HansV »

So what is your question?
Best wishes,
Hans

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Re: Inserting photo to a pre-determined size

Post by ABabeNChrist »

Hi Hans
I noticed with the code that I have when selecting different photos that are of different sizes it can change the size of inserted photo. I was hoping to come up with an absolute size for all selected photo. This way I could adjust the setting as to fit selected cell, then if additional photos are needed I could expand cell using check box.

User avatar
HansV
Administrator
Posts: 78524
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Inserting photo to a pre-determined size

Post by HansV »

The pictures that the user inserts can have different aspect ratios - some could be landscape, other portrait, and yet others square.
Do you want to fix the height of the inserted pictures and let the width vary?
Or do you want to fix the width and let the height vary?
Or do you want to fix both (causing the pictures to be distorted)?
Or something else?
Best wishes,
Hans

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Re: Inserting photo to a pre-determined size

Post by ABabeNChrist »

Hi Hans
I like option 1, fix the height of the inserted pictures and let the width
vary.

User avatar
HansV
Administrator
Posts: 78524
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Inserting photo to a pre-determined size

Post by HansV »

Simply remove the line

Code: Select all

            .Width = 27
from your code.
Best wishes,
Hans

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Re: Inserting photo to a pre-determined size

Post by ABabeNChrist »

I first removed the Width as you suggested and then added various photos while changing the height dimensions until I achieved a satisfied height. It’s not perfect but it will work :grin:
Thank you Hans