发布网友 发布时间:2022-02-21 13:28
共3个回答
热心网友 时间:2022-02-21 14:57
大概是这样,写在Worksheet的Change中就行了
Dim fn As String
fn = "E:\学生照片\" & ActiveSheet.Range("A1").Value & ".jpg"
If Target.Count > 1 Then Exit Sub
If Target.Value <> "" And Target.Address = "$A$1" Then
If ActiveSheet.Shapes.Count > 1 Then ActiveSheet.Shapes(2).Delete
If Dir(fn) <> "" Then
ActiveSheet.Range("G5").Select
ActiveSheet.Shapes.AddShape(msoShapeRectangle, ActiveCell.Left, ActiveCell.Top, ActiveCell.Width, ActiveCell.Height).Select
Selection.ShapeRange.Fill.Visible = msoFalse
Selection.ShapeRange.Line.Visible = msoFalse
Selection.ShapeRange.Fill.UserPicture fn
End If
End If
热心网友 时间:2022-02-21 16:15
值得学习借鉴的问题,顶一下!
热心网友 时间:2022-02-21 17:50
学习了,问一下Worksheet的Change在那个位置啊