- ©«¤l
- 835
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 915
- ÂI¦W
- 13
- §@·~¨t²Î
- Win 10,7
- ³nÅ骩¥»
- 2019,2013,2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-3
- ³Ì«áµn¿ý
- 2024-10-25
|
¥»©«³Ì«á¥Ñ luhpro ©ó 2011-5-1 23:35 ½s¿è
Hello Luhpro,
ÁÂÁ§AªºÀ°¦£, µ{¦¡¶]¨ì¤@¥b¥X²{§ä¤£¨ìYÈ
©êºp. §Ú¬Ý¿ù¥H¬°¤¤¶¡¨ºÓªí®æì¥ý´N¦s¦b, ©Ò¥H¤W±ªºµ{¦¡¬O»P¸Óªí®æ¤º®e°µ¤ñ¹ï¥HP¦³¿ù»~
¥H¤U¬°×¥¿«áªºµ{¦¡½X :
Sub FindLoc()
Dim iSource%, iX%, iY%, iDown, iLastY%, iComp%, iAns%, iNum%
iDown = [C65536].End(xlUp).Row ' §äì©l¸ê®Æ³Ì©³ºÝ
Range(Cells(2, 2), Cells(iDown, 3)).Sort _ ' ì©l¸ê®Æ±Æ§Ç
Key1:=Range("C1"), _
Key2:=Range("B1")
iX = Cells(2, 2) ' ²Ä 2 ¦C¸ê®Æª½±µ¥N¤J Y »P ³Ì¤pÈ ªºX
iLastY = Cells(2, 3)
Cells(2, 5) = iLastY
Cells(2, 6) = iX
iComp = 2 ' ¶×Á`ªí®æ
iAns = 2 ' ¯Ê¶µªí®æ
iSource = 3 ' ±q²Ä 3 ¦C¶}©l
iNum = iX + 1 ' »¼¼W¼Æ¦r¥H»Pì©l¸ê®Æ¤ñ¹ï
Do
iY = Cells(iSource, 3) '§ì¤U¤@µ§¸ê®Æ
iX = Cells(iSource, 2)
If iLastY <> iY Then ' Y ¦³·sÈ
Cells(iComp, 7) = Cells(iSource - 1, 2) ' ¥N¤J¤W¤@Ó Y ªº ³Ì¤jÈ ªºX
iComp = iComp + 1
Cells(iComp, 5) = iY '¥N¤J·sªº Y »P ³Ì¤pÈ ªºX
Cells(iComp, 6) = iX
iNum = iX
End If
Do While iNum <> iX ' ¦³¯Ê¶µ, ¥N¤J¸ê®Æ¨ì¯Ê¶µªí®æ¤¤, ª½¨ì¤£¦A¦³¯Ê¶µ
Cells(iAns, 9) = iNum
Cells(iAns, 10) = iY
iAns = iAns + 1
iNum = iNum + 1
Loop
iSource = iSource + 1
iNum = iNum + 1
iLastY = iY
Loop While iSource <= iDown ' ¤ñ¸û§¹²¦
Cells(iComp, 7) = Cells(iSource - 1, 2) ' ±a¤J³Ì«á¤@Ó ³Ì¤jÈ ªºX
End Sub
|
|