ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] Ãö©ó Find¥Îªk

¦^´_ 1# Helain
  1. Sub Ex()
  2.     Dim Myrange As Range, Rng As Range
  3.     Set Myrange = Range(Cells(6, 2), Cells(8, 4))
  4.     Set Rng = Myrange.Find(Cells(3, 2), , xlValues, xlWhole)
  5.     If Not Rng Is Nothing Then
  6.         Cells(1, 1) = Rng.Row
  7.         Cells(2, 1) = Rng.Column
  8.     End If
  9. End Sub
  10. '''''''''''''''''''''''''''''''''''
  11. Sub test()
  12. Dim Myrange As Range
  13. 'Set Myrange = Range(Cells(6, 2), Cells(8, 2))  '³o¸Ìªº Cells(8, 2) ¬O B8
  14. Set Myrange = Range(Cells(6, 2), Cells(8, 4))   '³o¸Ìªº Cells(8, 4) ¬O D8
  15. '´M§ä¤£¨ì   ¿ù»~Åã¥Ü: '¨S¦³³]©wª«¥óÅܼƩÎwith °Ï¶ôÅܼÆ
  16. Cells(1, 1) = Myrange.Find(Cells(3, 2), , xlValues, xlWhole).Row
  17. Cells(2, 1) = Myrange.Find(Cells(3, 2), , xlValues, xlWhole).Column
  18. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-11-10 08:22 ½s¿è

¦^´_ 6# Helain

½Ð¥ô·N¿é¤J "aaaaaaa"
RMax_Row = Cells.Find("aa", , xlValues, xlPart).Row
RMax_Row = Cells.Find("aa", , xlFormulas, xlPart).Row                  ¦³§ä¨ì:³o¨âµ{¦¡½X¨S¿ù»~

RMax_Row = Cells.Find("aa", , xlValues, xlWhole).Row
RMax_Row = Cells.Find("aa", , xlFormulas, xlWhole).Row           ¨S¦³§ä¨ì:³o¨âµ{¦¡½X·|¿ù»~    °}¦C¯Á¤Þ¶W¥X½d³ò

½Ð¤£­n¥Î¤W­±ªº»yªk ¥¿½Tªº¼gªk¦p¤U
expression.Find(What, After, LookIn, LookAt, SearchOrder, SearchDirection, MatchCase, MatchByte, SearchFormat)
Set R_Max = R_Profit.Find(What:=Rmax,LookIn:= xlFormulas,LookAt:= xlWhole)
Set R_Max = R_Profit.Find(LookIn:=xlFormulas, LookAt:=xlWhole, What:=Rmax)  
¥þ³¡¦³«ü©ú°Ñ¼Æ¥i¥ô·N©ñ¸m°Ñ¼Æªº¦ì¸m ¦ý¤£¥i¥H °ÑÂøµÛ¦³«ü©ú°Ñ¼Æ ¤Î¨S«ü©úªº°Ñ¼Æ

Set R_Max = R_Profit.Find(Rmax, ,  xlValues, xlWhole)  
Set R_Max = R_Profit.Find(Rmax, , xlFormulas, xlWhole)

¦p½T©w ¥ý«eªº·j´M¤£¬Oµù¸Ñ   LookIn:=xlComments ¥i¥Î
Set R_Max = R_Profit.Find(Rmax, ,  , xlWhole)
    If Not R_Max Is Nothing Then
        R_MaxRow = R_Max.Row
        R_Maxcolumn = R_Max.Column
    End If

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-11-10 14:10 ½s¿è

¦^´_ 9# Helain
½ÐÀˬd¤@¤U»yªkªº²Å¸¹
»yªk¥¿½T®É ²Ä1­Ó¦r¥À·|¬O¤j¼gªº      Row = QrF.Row   
¤£«Øij ¥ÎÃöÁä¦r°µÅܼƠ Row,Column ...
  1. If Not QrF Is Nothing Then
  2.         Row = QrF.Row
  3.         Column = QrF.Column
  4.     End If
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-11-10 15:16 ½s¿è

¦^´_ 11# Helain
Find ·j´Mªº±ø¥ó¦pªG¨S­«·s³]©w ·|¨Ì·Ó¤W¦¸ªº·j´M±ø¥ó¨Ó´M§äªº
Set QrF = R_Profit.Find(Application.Max(R_Profit), , , xlWhole)    ³o»yªk¨S«ü©w¬O (¤½¦¡ ¤º®e µù¸Ñ)  ¦³«ü©wÀx¦s®æªº¤º®e»Ý§¹¥þ¬Û¦P

½Ð¬d¬Ý7¼Ó Hsieh¶Wª©ªº¹Ï¤ù, ¬d¬d¬Ý  §A Excel¤W¦¸ªº·j´M±ø¥ó¬O (¤½¦¡ ¤º®e µù¸Ñ).

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-11-10 15:26 ½s¿è

¦^´_ 13# Helain
Find ·j´Mªº±ø¥ó¦pªG¨S­«·s³]©w ·|¨Ì·Ó¤W¦¸ªº·j´M±ø¥ó¨Ó´M§äªº
Set QrF = R_Profit.Find(a, , xlFormulas, xlWhole)
§A´M§äªº¬O¼Æ¦r »P ¤u§@ªí¤WÅã¥Ü¥Xªºªº¤å¦r(¼Æ¦r)¤£¤@¼Ë
  1. Sub test_3()
  2. Dim R_Profit As Range        'R's 2nd profit table
  3. Dim M_Profit As Range        'M's 2nd profit table
  4. Dim M_MaxProfit As Range     'For different Qr, M's Max profit
  5. Set R_Profit = Range(Cells(20, 2), Cells(30, 12))
  6. Set M_Profit = Range(Cells(2, 2), Cells(12, 12))
  7. Set M_MaxProfit = Range(Cells(15, 2), Cells(15, 12))
  8. MsgBox Application.Max(R_Profit)
  9. Set QrF = R_Profit.Find(Application.Max(R_Profit), , xlFormulas, xlWhole)
  10. MsgBox QrF.Text
  11.     If Not QrF Is Nothing Then
  12.         R = QrF.row
  13.         C = QrF.column
  14.     End If
  15. End Sub
½Æ»s¥N½X

TOP

¦^´_ 15# Helain
¦pªG»¡ range ¸Ì­±ªº­È­è¦n¦³¼Æ­Ó¬Û¦Pªº, ¨ºfind ¥i¥HŪ¶Ü?¬OÀH«KŪ¨ú¨ä¤¤¤@­Ó?
¦Û¤v¼g¼g ¸Õ¸Õ¬Ý.

¥t¥~, ­þÃ䦳VBA©Ò¦³¨ç¼Æ, ¥H¤Î»¡©ú©O?
VBA «ü¥O»¡©ú ±q¤¤ªº½d¨Ò ¥h¤@¤@Åé·|

TOP

        ÀR«ä¦Û¦b : ¬Ý§O¤H¤£¶¶²´¡A¬O¦Û¤v­×¾i¤£°÷¡C
ªð¦^¦Cªí ¤W¤@¥DÃD