Application.EnableEvents = False
if not dir(ThisWorkbook.Path & "\照片\" & Range("H7") & ".jpg" )="" then
With Sheet4
.Pictures(1).Delete
.Range("S7").Select
.Pictures.Insert ThisWorkbook.Path & "\照片\" & Range("H7") & ".jpg"
.Pictures(1).Top = Range("S7").MergeArea.Top + 1
.Pictures(1).Left = Range("S7").MergeArea.Left + 1
.Pictures(1).Height = Range("S7").MergeArea.Height - 1
.Pictures(1).Width = Range("S7").MergeArea.Width - 2
.Pictures(2).Delete
.Range("W1").Select
.Pictures.Insert ThisWorkbook.Path & "\身份证\" & Range("H7") & ".jpg"
Pictures(2).Top = Range("W1,AD8").Top
.Pictures(2).Left = Range("W1,AD8").Left + 2
.Pictures(2).Height = Range("W1,AD8").Height
.Pictures(2).Width = Range("W1,AD8").Width + 295
End With
end if
增加 if not dir(ThisWorkbook.Path & "\照片\" & Range("H7") & ".jpg" )="" then end if,无照片时,什么也不干。
你说的点击姓名的情况应该与本事件无关,查找其他原因。只点击不改变h7的内容是不会引发本事件的。
|