发布网友 发布时间:2022-04-23 03:46
共2个回答
热心网友 时间:2023-10-13 18:40
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 1 And Target.Row <> 1 Then Exit Sub
On Error Resume Next
Dim ph As String
With ActiveSheet
ph = ThisWorkbook.Path & "\" & Target & ".jpg" '图片地址,跟excel文件相同
.Pictures("pic").Delete
.Pictures.Insert(ph).Name = "pic"
.Pictures("pic").Top = Cells(1, 2).Top
.Pictures("pic").Left = Cells(1, 2).Left
End With
复制可以吗?
热心网友 时间:2023-10-13 18:41
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 1 And Target.Row <> 1 Then Exit Sub
On Error Resume Next
Dim ph As String
With ActiveSheet
ph = ThisWorkbook.Path & "\" & Target & ".jpg" '图片地址,跟excel文件相同
.Pictures("pic").Delete
.Pictures.Insert(ph).Name = "pic"
.Pictures("pic").Top = Cells(1, 2).Top
.Pictures("pic").Left = Cells(1, 2).Left
End With