• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User


  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA How to autofit image [SOLVED]

Dear All

I am trying to insert random image and resize it to match the picture place holder (just a square as background).
I just want to make sure the image size is smaller than the picture background but still maintain the original aspect ratio, how do i approach this problem?
I hope i make myself clear.

thanks in advance
Thanks vletm and Marc. I have not write the code yet as of tuesday because I am still looking for solution that needed the least code length. Anyway, I decided to make the background square (n x n size) and then i look for the bigger number between the length and width. Then I resize the bigger number to n size. The LockAspectRatio seems to be true by default.

How do I mark this as solved?


Excel Ninja
Without a sample file it's a challenge to offer valid code for Your needs.
As solved ... Try to edit Your thread-text and add [Solved] in the end.