- ©«¤l
- 17
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 55
- ÂI¦W
- 0
- §@·~¨t²Î
- winxp
- ³nÅ骩¥»
- office 2003 2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2010-10-1
- ³Ì«áµn¿ý
- 2022-2-18
|
[µo°Ý] ¨ú±o¥~³¡excelÀx¦s®æ¸ê®Æ¤º®eªº¤èªk
§Ú¦bºô¤W«÷´ê¤F¤U±ªº¥N½X¡ACells(i, 1)¤ÎCells(i, 2)¥i¥¿±`¦C¦L¡A
¥i¬O¦bCells(i, 3) = Workbooks(.SelectedItems(i)).Sheets("Sheet1").Range("A15").Value
µLªk¥¿±`Ū¨ú¦s¦ÜCells(i, 3) ¡A½Ð°Ý°ª¤â¬O¨º¸Ì¥X¿ù¤F
©ÎªÌ¨ä¥¦¿ëªk¨ú±o¡A
»s§@¥Dnªºn¨D¬O¡G
1.¿ï¨ú¸ê®Æ§¨¤¤ªº*.xls©Î*.xlsx
2.¦C¦L©Ò¿ïªºxls¤¤ªºSheet1 Àx¦s®æ¡A¦@¬ù60®æ(¥þ³¡"¤å¦r®æ¦¡"ªí¥Ü(¦p¤é´Á¡B®É¶¡¡B¼Æ¦r)¡A¤]¦³ªÅ¥Õ®æ)¡A¥þ³¡¤£¬Û¾F¡A±N¨äÅܦ¨°}¦C¡A¦A¥H°}¦C¤è¦¡¦C¦L¦¨ 5¦C*12Äæ- Sub Test()
- Columns("A:C").ClearContents
- With Application.FileDialog(msoFileDialogFilePicker)
- .InitialFileName = "C:\Users\¨Ï¥ÎªÌ\Desktop\" '«ü©wªì©l¸ô®|
- .AllowMultiSelect = True '¶}±Ò½Æ¿ï¥\¯à
- .Show
- For i = 1 To .SelectedItems.Count
- Cells(i, 1) = CreateObject("Scripting.FileSystemObject").GetParentFolderName(.SelectedItems(i)) & "\" 'Àɮ׸ô®|(§t¤é¤å)
- Cells(i, 2) = CreateObject("Scripting.FileSystemObject").GetFileName(.SelectedItems(i)) 'ÀɮצWºÙ(§t¤é¤å)
-
- Cells(i, 3) = Workbooks(.SelectedItems(i)).Sheets("Sheet1").Range("A15").Value 'µLªk¦¨¥\Ū¨ú
-
- 'MsgBox CreateObject("Scripting.FileSystemObject").GetFileName(.SelectedItems(i)) 'ÀɮצWºÙ
- 'MsgBox CreateObject("Scripting.FileSystemObject").GetParentFolderName(.SelectedItems(i)) & "\" 'Àɮ׸ô®| '(¦pªG¬O¥²»Ýªº¡A§A¥i¥H¦Û¤v¸É³Ì«áªº¡u\¡v)
-
- Next
- End With
- End Sub
½Æ»s¥N½X |
|