ads/auto.txt

How To Resize Image Vba

All About Image

How To Resize Image Vba. Sub resizeimagelockaspectratio dim myimage as shape dim imagewidth as double set myimage activesheet shapes picture 1 imagewidth 100 myimage lockaspectratio msotrue myimage width imagewidth end sub. Vba resize image.

Powerpoint Vba Code Reapply The Notes Master In 2020 Powerpoint Coding Master
Powerpoint Vba Code Reapply The Notes Master In 2020 Powerpoint Coding Master from www.pinterest.com

What i would like to do is ensure the image does not exceed the cell d4 regardless of the height width values so resize locking the aspect ratio. Click insert module and paste the following macro in the module window. In the attached spreadsheet the vba is set to resize the image in d4 based on the values entered in a1 w and a2 h this is the code used.

Therefore resizing the width or height will maintain the image s proportions.

Somebody at work is creating a whole lot of training material in word. Hold down the alt f11 keys and it opens the microsoft visual basic for applications window. Please login or register to view this content. I m trying to create a macro that will insert an image and then resize it to fit within a specified area cell range b24 j30 which are merged together without losing the width height ratio.