- ©«¤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
|
¦^´_ 1# morris0914
¸Õ¸Õ¬Ý- Sub Ex()
- Dim FilePath As String, Rng As Range, FS As Object, Ar
- FilePath = Sheets("Menu").Range("B1") 'Àɮ׸ê®Æ§¨"
- FilePath = FilePath & IIf(Right(1, 1) = "\", "", "\") 'Àˬd¸ê®Æ§¨§ÀºÝ¦³µL"\"
- Set Rng = Sheets("Menu").Range("D9") '²Ä1ÓÀɮצWºÙ
- Do
- Set FS = CreateObject("Scripting.FileSystemObject").GetFile(FilePath & Rng) '¨úªºÀɮת«¥ó
- 'FileSystemObject ´£¨Ñ¹ï¹q¸£Àɮרt²Îªº¦s¨úªºª«¥ó
- Set FS = FS.OpenAsTextStream(1, -2) 'TextStream ª«¥ó->¥[§Ö¹ïÀɮתº¶¶§Ç¦s¨ú¡C
- Ar = Split(FS.READALL, Chr(10)) 'Ū¨ú¸ê®Æ¦s¤J°}¦C Ar
- FS.Close ' ±NÀÉ®×Ãö³¬¡C
- With ActiveWorkbook '§@¥Î¤¤ªº¬¡¶Ã¯
- .Sheets.Add(, .Sheets(.Sheets.Count)).Name = Rng '·s¼W¤u§@ªí¥B©R¦W¬°ÀɮצWºÙ
- .Sheets(Rng.Value).[A1].Resize(UBound(Ar) + 1, 1) = Ar 'Ū¨úªº¸ê®Æ©ñ¤J·s¼W¤u§@ªí
- End With
- Set Rng = Rng.Offset(1) '¤U¤@ÓÀɮצWºÙ
- Loop Until Rng = "" '¨S¦³ÀɮצWºÙ Â÷¶}°j°é
- End Sub
½Æ»s¥N½X |
|