اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

الردود الموصى بها

قام بنشر

جرب هذا  

Private Sub Worksheet_Change(ByVal Target As Range)
Dim Patch As String, Img As Boolean, Strfile As String, Imgfile As String
If Not Intersect(Target, Range("k3")) Is Nothing Then
Dim rng As Range, Clé As String, Cpt As Long
Set WS = Feuil1: Set dest = Feuil2: Clé = dest.[k3]
 Set rng = WS.Columns("A:A").Find(What:=Clé, _
    LookIn:=xlFormulas, LookAt:=xlWhole, SearchOrder:=xlByRows, _
    SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
    Cpt = rng.Row
    dest.[F7] = WS.Cells(Cpt, 2).Value
    dest.[G7] = WS.Cells(Cpt, 3).Value
    dest.[H7] = WS.Cells(Cpt, 4).Value
    dest.[I7] = WS.Cells(Cpt, 5).Value
    dest.[J7] = WS.Cells(Cpt, 6).Value
    dest.[K7] = WS.Cells(Cpt, 7).Value
    dest.[L3] = WS.Cells(Cpt, 8).Value
    Patch = ThisWorkbook.Path
    Img = False
    On Error Resume Next
    Strfile = Dir(Patch & "\" & [L3].Value & ".*")
    Do While Len(Strfile) > 0
        If Len(Strfile) <> 0 Then
            Img = True
            Imgfile = Strfile
            Exit Do
            Else
        End If
    Loop
    If Img = True Then
        Me.Image1.Picture = LoadPicture(Patch & "\" & Imgfile)
        Me.Image1.PictureSizeMode = fmPictureSizeModeZoom
        Me.Image1.Left = [L6].Left: Me.Image1.Top = [L6].Top
        On Error GoTo 0
        Else
        MsgBox ("الصورة غير متوفرة")
        Me.Image1.Picture = Nothing
    End If
End If
End Sub

 

test.rar

  • Like 2

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information