- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 11# whirlwind963 - Option Explicit
- Sub Ex()
- Dim j As Integer, MyPath As String, MyFile As String, k, L
- For k = 1 To 2 'A,BÄæ
- For L = 4 To 5 'D,EÄæ
- j = 2
- While Cells(j, "C") <> "" 'CÄ欰ÀɦW
- MyPath = Cells(j, k) 'AÄæ,BÄ欰¦ì§}
- If UCase(Cells(j, "C")) Like "*W*" Then '¦r¦ê¤¤¦³"ABCD"
- On Error Resume Next
- MyFile = Dir(MyPath & "*" & Cells(j, "C") & "*.*") ' C2 = "ABCD" ->"1AABCD.png"
- If MyFile <> "" Then
- Cells(j, L).Select 'D,EÄæ
- With ActiveSheet.Pictures.Insert(MyPath & MyFile)
- .ShapeRange.LockAspectRatio = msoFalse
- .ShapeRange.Height = 100#
- .ShapeRange.Width = 100#
- .ShapeRange.Rotation = 0#
- .Placement = xlMoveAndSize
- .PrintObject = True
- End With
- End If
- End If
- j = j + 1
- Wend
- Range("C2").Select
- Next
- Next
- End Sub
½Æ»s¥N½X |
|