- ©«¤l
- 913
- ¥DÃD
- 150
- ºëµØ
- 0
- ¿n¤À
- 1089
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- office 2019
- ¾\ŪÅv
- 50
- ©Ê§O
- ¤k
- µù¥U®É¶¡
- 2011-8-28
- ³Ì«áµn¿ý
- 2023-7-19
|
¦U¦ì¤j¤j,
§Úª¦¤å¬d¤Fmacro1 $a$2,¦ü¥G¤S¬O¤@ºØ¯f¬r,¦ý¸Õ¤F´XºØ¤èªk³£¥u¯à±þ±¼·íÓÀɮתº¬r,¨Ï¶}±ÒÀɮ׮ɤ£·|¥X²{´£¥Ü"macro1 $a$2",¦pªG³oÓ¬r¤]¹³¬O¤§«e§Ú´¿µo°Ý¹Lªº§R°£¥¨¶°ªº¬r,§Ú·Q¥Î¦P¤@¼Ò¦¡,±NÀɮצb¶}±Ò«e¥ý§R°£"macro1 $a$2",¥H¤U¬O¤§«eHsieh¤j¤jÀ°§Ú¼gªº,¥i§_±µµÛ³oÓµ{¦¡¼g§R°£"macro1 $a$2"ªº¥¨¶°?³o¼Ë§Ú´N¥i¥H¤@¨Ö±N¬rµ¹±þ¤F!
©ÎªÌ¦pªG¤j¤j¦³§ó¦nªº¤èªk,¤]½Ð±Ð±Ð§Ú! ÁÂÁÂ!
- Sub Try()
- Dim fs
- Application.DisplayAlerts = False
- fd = ThisWorkbook.Path & "\" & Sheets(1).[E6] 'Àɮץؿý
- Set fos = CreateObject("Scripting.FileSystemObject")
- Set fdn = fos.getfolder(fd)
- Set fc = fdn.Files 'Àɮץؿý¤¤©Ò¦³ÀÉ®×
- For Each fs In fc
- [A1] = fs.Name 'É¥ÎÀx¦s®æÅã¥Ü¥¿½TÀɦW
- With Workbooks.Open(fd & "\" & [A1].Text, 0) ' ¶}±ÒÀɮפ£§ó·s³sµ²
- For Each vbc In .VBProject.VBComponents
- Select Case vbc.Type
- Case 100
- .VBProject.VBComponents(vbc.Name).CodeModule.DeleteLines 1, _
- .VBProject.VBComponents(vbc.Name).CodeModule.CountOfLines '§R°£©Ò¦³µ{¦¡½X
- Case Else
- .VBProject.VBComponents.Remove .VBProject.VBComponents.Item(vbc.Name) '²¾°£¼Ò²Õ¡Bªí³æ¡BÃþ§O¼Ò²Õ
- End Select
- Next
- .Close 1
- End With
- Next
- Range("A1").Select
- Selection.ClearContents
- '¦sÀÉ«áÃö³¬ÀÉ®×
- ActiveWorkbook.Save
- ActiveWorkbook.Close
- End Sub
½Æ»s¥N½X |
|