[µo°Ý]¦p¦ó±N½d³ò¤º²Å¦X±ø¥óªº¦r¦ê¦X¨Ö
- ©«¤l
- 6
- ¥DÃD
- 3
- ºëµØ
- 0
- ¿n¤À
- 52
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2014-1-3
- ³Ì«áµn¿ý
- 2021-6-20
|
[µo°Ý]¦p¦ó±N½d³ò¤º²Å¦X±ø¥óªº¦r¦ê¦X¨Ö
¥»©«³Ì«á¥Ñ chthonicfreddy ©ó 2016-11-29 11:47 ½s¿è
§Ú¦bºô¸ô¤W°Ñ¦Ò¤F¥H¤U½d¨Ò
Ãþ¦üvlookup¥\¯à¡A§Æ±æ¯àקï±N½d³ò¤º²Å¦X±ø¥óÀx¦s®æ¤ºªº¦r¦ê¦X¨Ö¬°¤@Ó¦r¦ê
·PÁ¦U¦ì¤j¤jªº«ü¾É
test.rar (12.41 KB)
Function WLOOKUP(X As Variant, M As Range, A As Byte, B As Integer)
'X ±ø¥ó
'M n¬d¸ßªº³æ¦C½d³ò
'A ªð¦^²ÄnӲŦX±ø¥óªºµ²ªG(255)
'B ªð¦^µ²ªGªº¦C¯Á¤Þ¡A¥i¥H¬O0©Ît¼Æ
' ¥Î©ó¼Æ¾Ú¬d¸ßªº³æ¦C½d³òM©Ò¦b¦CªºÈ¬°1¡A¥Nªí²Ä1¦C
' ¥k°¼²Ä¤@¦C¬°2,3,4.....;¥ª°¼²Ä¤@¦C¬°0,-1,-2.....
Dim i As Integer, mr As Range, y As Integer
i = Application.WorksheetFunction.CountIf(M, X)
'Set M =Intersect(M.Parent.Usedrange,M)
For Each mr In M
If mr.Value = X Then
y = y + 1
If y = A Then
WLOOKUP = mr.Offset(0, B - 1).Value
Exit Function
End If
End If
Next mr
WLOOKUP = ""
End Function |
|
|
|
|
|
|
- ©«¤l
- 1387
- ¥DÃD
- 4
- ºëµØ
- 0
- ¿n¤À
- 1397
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN
- ³nÅ骩¥»
- 2007
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2015-9-11
- ³Ì«áµn¿ý
- 2024-11-15
|
http://blog.xuite.net/hcm19522/twblog/472591392 |
|
|
|
|
|
|
- ©«¤l
- 6
- ¥DÃD
- 3
- ºëµØ
- 0
- ¿n¤À
- 52
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2014-1-3
- ³Ì«áµn¿ý
- 2021-6-20
|
¦^´_ 2# ã´£³¡ªL
·PÁ¤j¤jªº¦^ÂСA¹B¦æµL»~!!
·s¤â¤Jªù¡A·Q¦A½Ð±Ð±z²³æªº°ÝÃD
For i = 1 To xA.Rows.Count
¡@¡@If xA(i) = X Then T = Trim(T & " " & xB(i))
¤§«e¦bºô¸ô·j´M¸ê®Æªº®ÉÔ¦³¬Ý¨ì
Function MyConcat(Arr As Variant) As String
Dim A As Variant
For Each A In Arr
MyConcat = MyConcat & A
Next
MyConcat = MyConcat & A »P¤j¤jªº T = Trim(T & " " & xB(i)) ¬Ý°_¨Ó«ÜÃþ¦ü
¤]¦³¹Á¸Õ±q³oÓ¤è¦V¥h§äµª®×¡A¥u¬O¤~²¨¾Ç²L¡AÁÙ¬O·d¤£¤Ó²M·¡¤W±³o¬qªº¨Ï¥Î |
|
|
|
|
|
|
- ©«¤l
- 2833
- ¥DÃD
- 10
- ºëµØ
- 0
- ¿n¤À
- 2889
- ÂI¦W
- 0
- §@·~¨t²Î
- ¡e²¤¡f
- ³nÅ骩¥»
- ¡e²¤¡f
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¡e²¤¡f
- µù¥U®É¶¡
- 2013-5-13
- ³Ì«áµn¿ý
- 2024-11-16
|
Function WLOOKUP(X, xA As Range, xB As Range, SP$) As String
Dim i&, T$
For i = 1 To xA.Rows.Count
¡@¡@If xA(i) = X Then T = Trim(T & " " & xB(i))
Next i
WLOOKUP = Replace(T, " ", SP)
End Function
¤½¦¡¡G
=wlookup("A",C$2:C$11,A$2:A$11," ")
=wlookup(¤ñ¹ïÈ,¤ñ¹ï½d³ò,¨úȽd³ò,¤À¹j²Å¸¹)
¡@
Xl0000027.rar (11.15 KB)
¡@
¡@ |
|
|
|
|
|
|