- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 277
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-12-23
|
¦^´_ 4# tommy.lin
¤£À´ªº¦a¤è«öF1¬Ý»¡©ú¬O³Ì¦nªº®ÑÄy
Sub ex()
With Sheets("Sheet1")
If Application.CountA(.[B:B]) = 0 Then Exit Sub 'BÄæµL¸ê®Æ´N¸õ¥Xµ{§Ç
For Each a In .Range("B:B").SpecialCells(xlCellTypeConstants) '´`Àô¨CÓBÄ檺¸ê®Æ
With Sheets("Data")
Set c = .Rows(1).Find(a, lookat:=xlWhole) '¦bSheets("Data")²Ä¤@¦C§ä´M
k = IIf(Sheets("result").Cells(1, .Columns.Count).End(xlToLeft) = "", 0, 1) '°²¦pn½Æ»sªº¥Ø¼Ð¦ì¸m¦bSheets("result")ªºAÄæ¡A¦ì²¾¶q¬°0
Range(c, c.End(xlDown)).Copy Sheets("result").Cells(1, .Columns.Count).End(xlToLeft).Offset(, k) '½Æ»s¸ê®Æ
End With
Next
End With
End Sub |
|