|
版主你好,找到您2015的帖子,其中有一个EXCEL中可以单击图片使图片放大的代码,很好用,但是有一个问题就是,如果单元格中有两张及以上图片,单击其中的一张,所有的图片均放大。相互遮挡,请问有什么办法解决这一问题吗。谢谢
Sub test()
On Error Resume Next
For Each a In ActiveSheet.Shapes
If a.Type = 1 Or a.Type = 13 Then
If a.Name = Application.Caller And a.AlternativeText = Empty Then
a.AlternativeText = a.Height & Chr(28) & a.Width
a.Height = a.Height * 3
a.Width = a.Height * 3
a.ZOrder msoBringToFront
Else
a.Height = Split(a.AlternativeText, Chr(28))(0)
a.Width = Split(a.AlternativeText, Chr(28))(1)
a.AlternativeText = Empty
End If
Err.Clear
End If
Next
End Sub
|
|