SOLVED - Resize Image To Excel Window Size And Scale To Fit Automatically
Hello,
Wanted to know if it's possible to use a Macro to Scale the image on a sheet to automatically resize when the excel program is large or small?
John
1 Attachment(s)
Resize Image To Excel Window Size And Scale To Fit Automatically
Welcome to ExcelFox jjfletcher
What you have asked for is very much possible. There may be ways to hook the window using APIs, however if you want to do this using native VBA features in Excel, you will need to use Excel 2013 or above. The code below is just a sample to show you how this can be done in a rudimentary yet very effective way.
Code:
Private Sub Workbook_WindowResize(ByVal Wn As Window)
With ThisWorkbook.Sheets(1).Shapes(1)
.Width = Wn.VisibleRange.Width
.Height = Wn.VisibleRange.Height
End With
End Sub