Sub zz()
Set a = Workbooks("ÀÉ®×A.xls").Sheets(1)
Set b = Workbooks("ÀÉ®×B.xls").Sheets(1)
lastrow = a.[A1].End(xlDown).Row
lastcol = a.[A1].End(xlToRight).Column
rb = 1
For c = 2 To lastcol
¡@¡@For r = 2 To lastrow
¡@¡@¡@¡@If a.Cells(r, c) <> "" Then
¡@¡@¡@¡@¡@¡@b.Cells(rb, 3) = a.Cells(1, c)
¡@¡@¡@¡@¡@¡@b.Cells(rb, 4) = a.Cells(r, 1)
¡@¡@¡@¡@¡@¡@b.Cells(rb, 11) = a.Cells(r, c)
¡@¡@¡@¡@¡@¡@rb = rb + 1
¡@¡@¡@¡@End If
¡@¡@Next r
Next c
End Sub
¦VªO¥DÀËÁ| 203.79.168.37 (?)
--------------------------------------------------------------------------------
BEFORE ASKING, YOU SHOULD RTFH, RTFM, STFW...
For Each¡KNext语¥y结§ô¦Z¡A¤£会ªð¦^[¦^°é变¶q]¡A这ÉOFor¡KNext语¥y¤£¤@样:
Sub t4()
Dim c
For Each c In Array(1, 2, "aa")
Next
MsgBox TypeName(c)
End Sub
Sub t5()
Dim r As Range
For Each r In [a1:a4]
Next
MsgBox TypeName(r)
End Sub
Do¡KLoop语¥y¦³¥|Ïú§Î¦¡¡G
§Î¦¡1¡G
DO
¦^°éÊ^
Loop While 条¥ó
这Ïú§Î¦¡ªº执¦æ过µ{¬O¡G¥ý执¦æ¤@¹M¦^°éÊ^¡AµM¦Z¦A§P断条¥ó¬O§_¦¨¥ß¡AY条¥ó¦¨¥ß¡A 继续¤U¤@¦¸¦^°é¡F§_则¡A´N°h¥X¦^°é¡C
For Each¡KNext»y¥yµ²§ô«á¡A¤£·|ªð¦^[¦^°éÅܼÆ]¡A³o»PFor¡KNext»y¥y¤£¤@¼Ë:
Sub t4()
Dim c
For Each c In Array(1, 2, "aa")
Next
MsgBox TypeName(c)
End Sub
Sub t5()
Dim r As Range
For Each r In [a1:a4]
Next
MsgBox TypeName(r)
End Sub
Do¡KLoop»y¥y¦³¥|ºØ§Î¦¡¡G
§Î¦¡1¡G
DO
¦^°éÅé
Loop While ±ø¥ó
³oºØ§Î¦¡ªº°õ¦æ¹Lµ{¬O¡G¥ý°õ¦æ¤@¹M¦^°éÅé¡AµM«á¦A§PÂ_±ø¥ó¬O§_¦¨¥ß¡AY±ø¥ó¦¨¥ß¡A Ä~Äò¤U¤@¦¸¦^°é¡F§_«h¡A´N°h¥X¦^°é¡C