- ©«¤l
- 27
- ¥DÃD
- 7
- ºëµØ
- 0
- ¿n¤À
- 38
- ÂI¦W
- 0
- §@·~¨t²Î
- Win 7
- ³nÅ骩¥»
- Office 2007
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-9-19
- ³Ì«áµn¿ý
- 2014-2-18
|
¦U¦ì«e½ú¦n
¥Ø«e¥¿¦b¼g¤@Óµ{¦¡¡An§ì¨úӪѪº°]³ø¸ê®Æ¡A¨Ã¾ã²z¨ì¦P¤@ªí®æ
°õ¦æªºexcel¬°°]³ø²Îpªí.xlsx
A1 = 1101, A2 = 1102, A3 = 1103...µ¥ÓªÑ¥N½X
ӪѰ]³ø¬° 1101©u³ø¡B1102©u³ø...µ¥¡Aexcel¶±¦p¤U¹Ï
µ{¦¡½X¦p¤U
°õ¦æ«á·|²£¥Í "°}¦C¯Á¤Þ¶W¥X½d³ò"ªºµøµ¡
Sub Getdata()
For i = 2 To 5
Dim WB1 As Workbook
Workbooks.Open Filename:="C:\Users\user\Documents\KT\§ë¸ê²z°]\Excel¤ÀªR¼Ò²Õ\" & Range("A" & i) & "©u³ø.xlsx", UpdateLinks:=False, ReadOnly:=True
Set WB1 = ActiveWorkbook
With Workbooks(°]³ø²Îpªí).Worksheets("sheet1")
Range("E" & i).FormulaR1C1 = "=[" & Range("A" & i) & "©u³ø.xlsx]ISQ!R4C2"
Range("F" & i).FormulaR1C1 = "=[" & Range("A" & i) & "©u³ø.xlsx]ISQ!R5C2"
End With
WB1.Close
Next i
End Sub
Y¨Ï¥Î"On Error Resume Next"
µ{¦¡°õ¦æ·|Ū¨ú¥¿½T¸ê®Æ¡A¦ý§ÚÁÙ¬O·Qª¾¹D¯u¥¿°ÝÃD¥X¦bþ...
1. ½Ð±Ð¿ù»~¥X²{¦bþÓ¦a¤è¡H
¤@¶}©l´ú¸Õ¥i°õ¦æ Range("E" & i).FormulaR1C1 = "=[1101©u³ø.xlsx]ISQ!R4C2"
קï«á, ¥[¤JÅܼƫK²£¥Í¿ù»~ Range("E" & i).FormulaR1C1 = "=[" & Range("A" & i) & "©u³ø.xlsx]ISQ!R4C2
2. With sheet1ªº±¡ªp¤U¡A¤£¬OÀ³¸Ó³£n¼g¦¨ " .range(....) "¶Ü¡H¬°¦ó¦b¦¹¤£¥²¼W¥[ "."©O¡H
ÁÂÁ¦U¦ì«e½ú«ü±Ð~ |
|