- ©«¤l
- 472
- ¥DÃD
- 5
- ºëµØ
- 0
- ¿n¤À
- 485
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows
- ³nÅ骩¥»
- MS Office
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- ¨Ó¦Û
- »´ä
- µù¥U®É¶¡
- 2010-7-4
- ³Ì«áµn¿ý
- 2014-12-28
|
¥ý§ä¤@¦¸aaa,¦A§ä¤@¦¸bbb.
³Ì«áªºfinalrange·|Åã¥Ü ¨âÓÈ ³£¦³ªºcell
¨ú¥Nªº¸Ü§A¥i¥H¦b§ä¥X¨Óªºrange¦A°µ¤â¸}
Dim result1 As Range, result2 As Range, finalresult As Range
With Worksheets(1).Range("a1:C500")
Set c = .Find("aaa", LookIn:=xlValues)
firstAddress = c.Address
If Not c Is Nothing Then
Set result1 = c
Do
Set result1 = Union(result1, c)
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
With Worksheets(1).Range("a1:C500")
Set c = .Find("bbb", LookIn:=xlValues)
firstAddress = c.Address
If Not c Is Nothing Then
Set result2 = c
Do
Set result2 = Union(result2, c)
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
Set finalresult = Intersect(result1, result2)
msgbox(finalresult.Address) |
|