mmn1000
Board Regular
- Joined
- Mar 17, 2020
- Messages
- 76
- Office Version
- 2019
- 2013
- Platform
- Windows
Hello
I use the following code to enlarge photos in Excel
Good for a few right-click photos and select Assign Macro
Now I want to use this code for a lot of shared photos
By clicking on each photo, I can enlarge it
If I want to use the right click method, it's time consuming and tedious
How can I make this code public for all photos to zoom in on them?
Or the new photo that I add to the file will automatically follow this code
I hope I get what I want
I use the following code to enlarge photos in Excel
VBA Code:
Sub all_Click()
Dim H As Long
Dim w As Long
Dim Shp As Shape
For Each Shp In ActiveSheet.Shapes
If Shp.Type = 13 Then
Shp.Width = Shp.TopLeftCell.Width * 3
Shp.Height = Shp.TopLeftCell.Height * 3
End If
Next Shp
With ActiveSheet.Shapes(Application.Caller).OLEFormat.Object
.Width = .TopLeftCell.Width * 6
.Height = .TopLeftCell.Height * 11
.ShapeRange.ZOrder msoBringToFront
End With
End Sub
Now I want to use this code for a lot of shared photos
By clicking on each photo, I can enlarge it
If I want to use the right click method, it's time consuming and tedious
How can I make this code public for all photos to zoom in on them?
Or the new photo that I add to the file will automatically follow this code
I hope I get what I want