求助,VBA插入图片
单元格AJ35中,输入图片文件名,在g48:w62插入对应BMP图片,现在想在a233:q237也插入此图片,应该怎样修改以下语句?Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range, fp$, shnm$, nm$, shp As Shape
Dim tp, lf, wd
Set rng = [g48:w62]
If Target.Count > 1 Then Exit Sub
If Target = "" Then Exit Sub
If Target.Address <> "$AJ$35" Then Exit Sub
fp = ThisWorkbook.Path & "\图片\"
nm = fp & "\" & Target.Value & ".bmp"
For Each shp In ActiveSheet.Shapes
If shp.Type = msoAutoShape Then
shp.Delete
End If
Next
nn = Dir(nm)
If nn <> "" Then
With rng
ML = .Left
MT = .Top
MW = .Width
MH = .Height
ActiveSheet.Shapes.AddShape(msoShapeRectangle, ML, MT, MW, MH).Select
Selection.ShapeRange.Fill.UserPicture nm
End With
End If
Target.Select
End Sub