Stop searching. Start learning and developing your excel skills.
Macro
VBA
Formula
Function
Shortcut
Tricks

» » VBA To Enlarge Picture

VBA To Enlarge Picture

June 03, 2017 |
The Code:
Option Explicit
Dim fd As Boolean
Sub EnlargePicture()
Call Picture_Click
End Sub
Sub Picture_Click()
Dim i, j As Long
Dim sh As Shape
i = 200
j = 300
Set sh = ActiveSheet.Shapes(Application.Caller)
fd = fd Xor True
    With sh
        If fd Then
            .Width = i
            .Height = j
        Else
            .Width = .TopLeftCell.ColumnWidth
            .Height = .TopLeftCell.RowHeight
        End If
    End With
End Sub
Note:
  1. Adjust i and j according to requirements
How it works:
  1. It will enlarge the picture when you click on it
  2. It will resize to original size when you re-click on it

No comments:

Post a Comment