- ©«¤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
|
¦^´_ 3# cmo140497
If InStr(UCase(P.Name), ".JPG") Then -> If InStr(UCase(P.Name), ".JPG")=True Then
P.Name ¦b¦¹µ{¦¡¤¤->¨Ì§Ç¶Ç¦^¨C¤@¸ê®Æ§¨¤¤ªºFileªº¦WºÙ
InStrªº¤ñ¹ï¬O¦³¤À¤j¤p¼gªº,¦pInStr¦³¤ñ¹ï¨ì®É>0 ¨t²Î±N>0ªº¼ÆÈÂà´«¦¨ True
¸Õ¸Õ¬Ý- Sub Ex()
- Dim Fs As Object, E, i As Integer, P, ii As Integer
- Dim xlPath As String
- With Application.FileDialog(msoFileDialogFolderPicker)
- .AllowMultiSelect = False 'True ¦pªG¤¹³\¨Ï¥ÎªÌ±qÀÉ®×¹ï¸Ü¤è¶ô¿ï¨ú¦hÓÀÉ®×
- .Show
- If .SelectedItems.Count = 0 Then Exit Sub
- xlPath = .SelectedItems(1)
- End With
- With CreateObject("Scripting.FileSystemObject").GetFolder(xlPath)
- i = 1
- For Each E In .SubFolders
- If i > ActiveWorkbook.Sheets.Count Then
- Sheets.Add(, Sheets(Sheets.Count)).Name = E.Name
- Else
- Sheets(i).Name = E.Name
- End If
- ii = 1
- For Each P In E.Files
- If InStr(UCase(P.Name), ".JPG") Then
- With Sheets(i).Pictures.Insert(P)
- .Top = Cells(ii, 2).Top
- .Left = Cells(ii, 2).Left
- .Width = 50
- .Height = 50
- End With
- ii = ii + 5
- End If
- Next
- i = i + 1
- Next
- End With
- End Sub
½Æ»s¥N½X |
|