ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¦p¦ó¦b¥t¤@Àɮק@¦Û°Ê°O¿ý

[µo°Ý] ¦p¦ó¦b¥t¤@Àɮק@¦Û°Ê°O¿ý

ªþ¥ó¤¤¡A¨C·íE1¦³§ïÅܮɡA¦bD:\VBA\°O¿ý.xlsxªºSheet1¤¤¡A«ö®É§Ç¥ÑA1¦V¤U¡A°O¿ý¨C²ÕC1¦ÜF5
½Ð±Ð¦U¤j¤j¥i¥H°µ¨ì¶Ü¡AÁÂÁÂ!

TEST1.rar (6.9 KB)

http://forum.twbts.com/viewthrea ... p;extra=&page=2
¥i¥H¤F¡AÁÂÁÂHsiehª©¤j!

TOP

¦^´_ 2# donod

½Ð±Ð¦U¦ì¤j¤j¡A¦p¦ó¹ê®É°O¿ý¦bD:\VBA\°O¿ý.xlsxªºSheet1¤¤?

TOP

ÁÂÁ­㴣³¡ª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)

TOP

²³æ¨Ó»¡¡A¥H¤Wªþ¥ó¨Ò¤l¬O¹ê®É±Nsheet1«ü©wªº¸ê®Æ¡A¤£Â_°O¿ý¨ìsheet2¡A
½Ð±Ð¤j¤j¥i§_§ï¬°¹ê®ÉSAVE¨ì¥t1ÀÉ®×D:\VBA\°O¿ý.xlsxªºSheet1¤¤¡A¦ýD:\VBA\°O¿ý.xlsx¬O¤£¥´¶}ªº¡A
¦pªG¤Ó®ø¯Ó¸ê·½¡A¥i§ï¬°¨C15¤ÀÄÁSAVE¨ìD:\VBA\°O¿ý.xlsxªºSheet1¤¤¡A
ÁÂÁÂ!

TOP

        ÀR«ä¦Û¦b : ºw¤ô¦¨ªe¡C²É¦Ì¦¨ÅÚ¡A¤Å»´¤vÆF¡A¤Å¥Hµ½¤p¦Ó¤£¬°¡C
ªð¦^¦Cªí ¤W¤@¥DÃD