|
Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Type POINTAPI
x As Long
y As Long
End Type
Dim pd As Boolean, 鼠标位置图片, 前面已选图片
Sub 缩放图片()
On Error Resume Next
Dim 鼠标位置 As POINTAPI, Target
pd = True
Do While pd = True
GetCursorPos 鼠标位置
Set 鼠标位置图片 = ActiveWindow.RangeFromPoint(鼠标位置.x, 鼠标位置.y)
If 鼠标位置图片 Is Nothing Then
GoTo 100
Else
If 鼠标位置图片.Name <> 前面已选图片.Name Then
With 鼠标位置图片
.Width = .Width * Range("H1")
.Height = .Height * Range("H1")
.ShapeRange.ZOrder msoBringToFront
End With
100:
With 前面已选图片
.Width = .Width / Range("H1")
.Height = .Height / Range("H1")
End With
End If
End If
Set 前面已选图片 = 鼠标位置图片
DoEvents
Loop
End Sub
Sub 关闭缩放()
pd = False
End Sub
鼠标移动缩放图片,以上代码是在网络上找的,请问如果要指定单元格区域范围内有效,范围外无效的话要怎么修改呢
|
|