- ©«¤l
- 258
- ¥DÃD
- 77
- ºëµØ
- 0
- ¿n¤À
- 385
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- Taiwan
- µù¥U®É¶¡
- 2010-8-8
- ³Ì«áµn¿ý
- 2021-1-25
|
¦^´_ 4# baconbacons
¸Õ¸Õ¬Ý §Ú´¿¸g¼g¹L
Sub test()
Dim FileName As Variant
Dim xlfileName As String
Dim FolderName As Variant
Dim f1 As Object
Set f1 = CreateObject("Scripting.FileSystemObject")
Set myfiles = f1.GetFolder(ThisWorkbook.Path ).Files
n = 0
For Each myfile In myfiles
If UCase(f1.getextensionname(Path:=myfile)) = "JPG" _
Or UCase(f1.getextensionname(Path:=myfile)) = "JPEG" _
Or UCase(f1.getextensionname(Path:=myfile)) = "GIF" _
Or UCase(f1.getextensionname(Path:=myfile)) = "BMP" Then
n = n + 1
End If
MsgBox n
Set f1 = Nothing
End Sub |
|