- ©«¤l
- 163
- ¥DÃD
- 45
- ºëµØ
- 0
- ¿n¤À
- 246
- ÂI¦W
- 28
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- ie
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2015-7-8
- ³Ì«áµn¿ý
- 2024-12-7
|
[µo°Ý] FileDialog(msoFileDialogFilePicker) ¶}±Ò«ü©wÀÉ®×
¦U¦ì¤j¤j§A¦n
¥H¤Uªºµ{¦¡¬O¦bºô¤W§ä¨ìªº, ¥Î³~¬O¦b¶}±Ò¤@Óexcel Àɮפ§«á°õ¦æ¥H¤Uµ{¦¡, ¥i¥H¼u¥X¤@Ó¿ï®Ø¬[¥i¥H¦Û¦æ¥ô·N¿ï¨ú¬Y¤@Óexcel Àɮרýƻs©Ò¦³¤u§@ªí¨ì²{¦b¥´¶}ªºexcel file,
·í¿ï¨úÀɮ׫á´N¤£¯à½Æ»s¤u§@ªí, ½ÐÀ°¦£¬Ý¬Ý«üÂIµ{¦¡°ÝÃD¦b¨º¨½, ÁÂÁÂ
Sub test()
Dim FName As String, FPath As String
Dim sheet As Worksheet
Dim FDialog As FileDialog
Application.ScreenUpdating = False
Set FDialog = Application.FileDialog(msoFileDialogFilePicker)
If FDialog.Show = -1 Then
FPath = FDialog.SelectedItems(1)
End If
'FName = Dir(FPath & "\*.xlsx*")
Do While FPath <> ""
Workbooks.Open Filename:=FPath, ReadOnly:=True
For Each sheet In ActiveWorkbook.Sheets
sheet.Copy After:=ThisWorkbook.Sheets(1)
Next sheet
Workbooks(FPath).Close
Loop
Application.ScreenUpdating = True
End Sub |
|