Giúp em với !
E có 1 ảnh nhân viên ở trong ổ D . E tạo 1 text box ảnh và 1 text box mã nhân viên . em muốn nhập mã nhân viên vào text box thì sẽ có ảnh ra .
Các bác xem file đính kèm !
E tham khảo code này nhưng chưa biết chỉnh ntn
Private Sub Worksheet_Change(ByVal Target As Range)
Dim strPic
On Error Resume Next
If Target.Address = "$E$8" Then
strPic = Target.Parent.Range("K4").Value
With Sheet1.Shapes("PicFrame").Fill
If strPic <> 0 Then
.UserPicture CStr(strPic)
Else
.Solid: .ForeColor.SchemeColor = 12
End If
End With
End If
End Sub
E có 1 ảnh nhân viên ở trong ổ D . E tạo 1 text box ảnh và 1 text box mã nhân viên . em muốn nhập mã nhân viên vào text box thì sẽ có ảnh ra .
Các bác xem file đính kèm !
E tham khảo code này nhưng chưa biết chỉnh ntn
Private Sub Worksheet_Change(ByVal Target As Range)
Dim strPic
On Error Resume Next
If Target.Address = "$E$8" Then
strPic = Target.Parent.Range("K4").Value
With Sheet1.Shapes("PicFrame").Fill
If strPic <> 0 Then
.UserPicture CStr(strPic)
Else
.Solid: .ForeColor.SchemeColor = 12
End If
End With
End If
End Sub



