Hello, I was wondering if someone could help me with the following code? I'm basically trying to create thumbnails then have them enlarge once you click on them. I can make it work for a single picture like "Picture 6" but then I'd have to write a separate macro for each one.
Is there a way I can do this such that instead of calling each picture I can use something like "Selected picture"?
I'm new to this and most of what I've developed so far is what I've garnered from the web.
Help is greatly appreciated! Code is as follows:
Sub Picture5_Click()
ActiveSheet.Shapes("Picture 6").Select
If Selection.Width < 100 Then Enlarge Else Reduce
End Sub
Sub Enlarge()
Selection.ShapeRange.LockAspectRatio = msoTrue
Selection.Placement = xlMoveAndSize
Selection.ShapeRange.Width = 5 * Selection.ShapeRange.Width
ActiveSheet.Range("B128").Select
End Sub
Sub Reduce()
Selection.ShapeRange.LockAspectRatio = msoTrue
Selection.Placement = xlMoveAndSize
Selection.ShapeRange.Width = 0.2 * Selection.ShapeRange.Width
ActiveSheet.Range("B128").Select
End Sub
Is there a way I can do this such that instead of calling each picture I can use something like "Selected picture"?
I'm new to this and most of what I've developed so far is what I've garnered from the web.
Help is greatly appreciated! Code is as follows:
Sub Picture5_Click()
ActiveSheet.Shapes("Picture 6").Select
If Selection.Width < 100 Then Enlarge Else Reduce
End Sub
Sub Enlarge()
Selection.ShapeRange.LockAspectRatio = msoTrue
Selection.Placement = xlMoveAndSize
Selection.ShapeRange.Width = 5 * Selection.ShapeRange.Width
ActiveSheet.Range("B128").Select
End Sub
Sub Reduce()
Selection.ShapeRange.LockAspectRatio = msoTrue
Selection.Placement = xlMoveAndSize
Selection.ShapeRange.Width = 0.2 * Selection.ShapeRange.Width
ActiveSheet.Range("B128").Select
End Sub