- ©«¤l
- 140
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 167
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN 7
- ³nÅ骩¥»
- OFFICE 2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-2-26
- ³Ì«áµn¿ý
- 2023-1-30
|
ÁÂÁÂã´£³¡ªLª©¤j´£¨Ñ!
http://forum.twbts.com/viewthrea ... t%A4%40%C0%C9%AE%D7
½Ð±Ð¦U¦ì¤j¤j¡A¦p¦ó§ï¼g¦bªþ¥ó¤¤?(¨C·íE2¦³§ïÅܮɡA¦bD:\VBA\°O¿ý.xlsxªºSheet1¤¤¡A«ö®É§Ç¥ÑA2¦ÜD2¦V¤U¡A°O¿ý¨C²ÕC2¦ÜF2)
Sub TEST()
Dim A As Range, B As Range, N%
Dim X As New Application, FN$, xB As Workbook
For Each A In [F4:G4]
N = N + 1
FN = ThisWorkbook.Path & "\" & A.Value & "°O¿ý.xlsx"
If Dir(FN) = "" Then GoTo 101
Set xB = X.Workbooks.Open(FN)
For Each B In [E5:E14]
On Error Resume Next
If Range(B.Value) Is Nothing Then GoTo 102
On Error GoTo 0
xB.Sheets(1).Range(B).Value = B(1, N + 1)
102: Next
xB.Close 1
101: Next
End Sub
test1.rar (18.67 KB)
|
|