|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
有哪位大佬能帮我看下是什么情况可以吗
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$C$5" Then Exit Sub
On Error Resume Next
Dim mr As Range
Dim shap As Shape
Dim str As String, str1 As String
For Each shap In ActiveSheet.Shapes
str = shap.Name
str1 = shap.TopLeftCell.Address
If str1 = "$E$16" And Target.Value <> "" Then
Shapes(str).Select
Selection.Delete
Exit For
ElseIf str1 = "$E$16" And Target.Value = "" Then
Shapes(str).Select
Selection.Delete
Exit Sub
End If
Next
If Dir(ActiveWorkbook.Path & "\图片" & Target.Value & ".jpg") = "" Then
MsgBox "图片不存在,请重新输入!"
Exit Sub
Else
Set mr = Range("E16")
mr.Select
ML = mr.Left
MT = mr.Top
MW = mr.Width
MH = mr.Height
ActiveSheet.Shapes.AddShape(msoShapeRectangle, ML, MT, MW, MH).Select
Selection.ShapeRange.Line.Visible = msoFalse '矩形无线条
Selection.ShapeRange.Fill.UserPicture _
ActiveWorkbook.Path & "\图片" & Target.Value & ".jpg" '当前文件所在目录下以当前C5单元格内容为名称的.jpg图片
End If
Range("C6").Select
End Sub
|
-
查询显示动态图片提示图片不存在的问题
-
-
仓库快速找料管理.rar
191.6 KB, 下载次数: 0
查询显示动态图片提示图片不存在的问题
|