Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub ImageClick()
- Dim shp As Shape
- Dim big As Single, small As Single
- Dim shpDouH As Double, shpDouOriH As Double
- big = 3
- small = 1
- 'On Error Resume Next
- Set shp = ActiveSheet.Shapes(Application.Caller)
- With shp
- shpDouH = .Height
- .ScaleHeight 1, msoTrue, msoScaleFromTopLeft
- shpDouOriH = .Height
- If Round(shpDouH / shpDouOriH, 2) = big Then
- .ScaleHeight small, msoTrue, msoScaleFromTopLeft
- .ScaleWidth small, msoTrue, msoScaleFromTopLeft
- .ZOrder msoSendToBack
- Else
- .ScaleHeight big, msoTrue, msoScaleFromTopLeft
- .ScaleWidth big, msoTrue, msoScaleFromTopLeft
- .ZOrder msoBringToFront
- End If
- End With
- End Sub
- ''''''''''''''''''''''''''''''''''''''''''''''''''''
- Private Sub Worksheet_Activate()
- Dim image As Shape
- Dim suffix As String
- Dim counter As Long
- counter = 1
- For Each image In ActiveSheet.Shapes
- suffix = "r!" + Format(counter, "00000")
- If Not InStr(image.Name, "r!") Then
- image.Name = image.Name + suffix
- End If
- counter = counter + 1
- Next image
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement