ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Code to resize image (https://www.excelbanter.com/excel-programming/436141-code-resize-image.html)

Gotroots

Code to resize image
 
I want to use a command button to resize an image in a worksheet. I tried to
generate the code by recording a macro. However I have just leaned this is
not possible using Office 2007.

Most great full if someone could assist with supplying the code for this.

Barb Reinhardt

Code to resize image
 
Dim myWS as excel.worksheet
Dim myShape as Excel.Shape

Set myWS = ActiveSheet
Set myShape = myWS.Shapes("EnterShapeName")

With myShape
.LockAspectRatio = msoFalse
.width = 500
.height = 300
end with

--
HTH,

Barb Reinhardt



"Gotroots" wrote:

I want to use a command button to resize an image in a worksheet. I tried to
generate the code by recording a macro. However I have just leaned this is
not possible using Office 2007.

Most great full if someone could assist with supplying the code for this.



All times are GMT +1. The time now is 03:17 AM.

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