- ©«¤l
- 438
- ¥DÃD
- 67
- ºëµØ
- 0
- ¿n¤À
- 531
- ÂI¦W
- 30
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-10-30
- ³Ì«áµn¿ý
- 2024-10-24
|
¤@对¦h¬d询 (2).rar (17.04 KB)
¸ê®Æ®w
©m¦W 时间 参赛项¥Ø
张¤j«G 2/5/2010 ¥Ð径
陈¬P 2/5/2010 ¥Ð径
¬h»» 2/5/2010 ¥Ð径
张¤j«G 3/5/2010 ¸õ¤ô
赵¤j¦~ 3/5/2010 ¸õ¤ô
刘¬P¬P 3/5/2010 ¸õ¤ô
张¤j«G 4/5/2010 ·Æ¦B
¦¶丽丽 4/5/2010 ·Æ¦B
赵¤j¦~ 4/5/2010 ·Æ¦B
刘ÅÅ 5/5/2010 §L¥ã
吴ªÚ华 5/5/2010 §L¥ã
VBA «á
¬d询对¶H 参赛项¥Ø 时间
张¤j«G ¥Ð径 2/5/2010
¸õ¤ô 3/5/2010
·Æ¦B 4/5/2010
'声©ú¨ç数Look¡A类«¬为String.¥]¬A¥|个参数¡A«e两个为¥²选参数¡A¦Z两个为¥i选参数
Function look(¬d§äÈ As String, 区°ì As Range, Optional ¦C As Integer = 2, Optional ¯Á¤Þ号 As Integer = 1) As String
Application.Volatile '声©ú为©ö¥¢©Ê¨ç数
Dim i As Long, cell As Range, Str As String
With 区°ì.Columns(1) '¤Þ¥Î区°ìªº²Ä¤@¦C
'¦pªG¤Þ¥Î区°ì²Ä¤@个单¤¸®æµ¥¤_¬d§äªº对¶H¡A¨º¤\将该单¤¸®æ赋¤©变¶qCell¡C§_则¨Ï¥ÎFind¤èªk¬d§ä¡A将§ä¨ìªº单¤¸®æ赋¤©变¶qCell
If .Cells(1) = ¬d§äÈ Then Set cell = .Cells(1) Else Set cell = .Find(¬d§äÈ, LookIn:=xlValues, lookat:=xlWhole)
If Not cell Is Nothing Then '¦pªG§ä¨ì
Str = cell.Address '记录单¤¸®æ¦a§}
Do '³q过´`环继续¬d§ä
i = i + 1 '²Ö¥[变¶q
'¦pªG变¶qµ¥¤_³Ì¦Z¤@个参数¡A¨º¤\将¬d§ä¨ìªº单¤¸®æ¥k边ªºÈ赋¤©Look¨ç数
If i = ¯Á¤Þ号 Then look = cell.Offset(0, ¦C - 1): Exit Function
Set cell = 区°ì.Find(¬d§äÈ, cell, , xlWhole) '¬d§ä¤U¤@个
Loop While cell.Address <> Str
Else
look = "" '¦pªG§ä¤£¨ì则ª½±µªð¦^ªÅ¥Õ
End If
End With
End Function |
|