| ©«¤l262 ¥DÃD8 ºëµØ0 ¿n¤À280 ÂI¦W0  §@·~¨t²Îxp ³nÅ骩¥»Office 2007 ¾\ŪÅv20 ©Ê§O¨k ¨Ó¦ÛHK µù¥U®É¶¡2015-8-11 ³Ì«áµn¿ý2025-3-24 
 
 | 
                
| ½Æ»s¥N½XSub zz()
Dim p, pic, pn$, Newpic As Object, k
With Application.FileDialog(msoFileDialogFolderPicker)
    .Title = "Select the images folder"
    .Show
    If .SelectedItems.Count Then p = .SelectedItems(1) & "\" Else Exit Sub
End With
Sheets(2).Activate
pic = Dir(p & "*.jpg")
Do While Len(pic) > 0
    pn = Mid(Split(pic, ".")(0), 3)
    k = Split(pn, "-")
    pn = Format(k(0), "0000") & "-" & k(1)
    Set Rng = Cells.Find(pn)
    If Rng Is Nothing Then MsgBox "No picture " & pic: GoTo 1000
    Set Rng = Range(Rng.MergeArea.Address)
    For Each op In ActiveSheet.Pictures
        If Not Application.Intersect(Rng, op.TopLeftCell) Is Nothing Then op.Delete
    Next
    Set Newpic = ActiveSheet.Pictures.Insert(p & pic)
    With Newpic
        .ShapeRange.LockAspectRatio = msoFalse
        .Top = Rng.Top
        .Left = Rng.Left
        .Height = Rng.Height
        .Width = Rng.Width
    End With
1000
pic = Dir
Loop
End Sub
 | 
 |