- ©«¤l
- 234
- ¥DÃD
- 19
- ºëµØ
- 0
- ¿n¤À
- 276
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows XP
- ³nÅ骩¥»
- office 2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2013-1-7
- ³Ì«áµn¿ý
- 2021-10-7
|
¦^´_ 5# PJChen
¥\¤O¨S«Ü¦n,½Ð¸Õ¸Õ
¸ê®Æ§¨³]©w¬°A,¦pnÅܰʽЦۦæקï(§tÀx¦s¸ô®|)
Sub ´ú¸Õ()
Dim Wb As Workbook, Sh As Worksheet, x As Range, Source1 As String
Source1 = Workbooks("Macro.xlsm").Worksheets("VBA").Range("B1").Value 'n¶}±ÒªºÀɮצWºÙ
Workbooks.Open "c:\A\" & Source1 & ".xlsx" '¶}±Òn¼g¤JªºÀÉ®×
Workbooks("Macro.xlsm").Activate
Set Wb = Workbooks(Workbooks("Macro.xlsm").Worksheets("VBA").Range("B1").Value) 'Àx¦s®æªºÈ¬°ÀɮצWºÙ
Set Sh = Wb.Worksheets(Worksheets("VBA").Range("B2").Text) 'Àx¦s®æªºÈ¬°¤u§@ªí¦WºÙ,¦]¬°¤u§@ªí¦WºÙ¬O¼Æ¦r,·|³Q·í¦¨"¼Æ²ÄNÓ¤u§@ªí",ÁÙµLªk¸Ñ¨M,¥H¥[1¥ý¼È¥Î
Sh.Activate
With Sh
Set x = Sh.Range(Workbooks("Macro.xlsm").Worksheets("VBA").Range("B5").Text) '«ü©w¼g¤JªºÀx¦s®æ¬°©ñ¦b¨ºÓÄæ¦ì
x = Workbooks("Macro.xlsm").Worksheets("VBA").Range("B4").Text '¼g¤HªºÈ©ñ¦b¨ºÓÄæ¦ì
End With
Workbooks(Dir("C:\A\" & Source1 & ".xlsx")).Close True 'Ãö³¬¨ÃÀx¦s¼g¤JªºÀÉ®×
End Sub |
|