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

Excel ´M§ä ¦hµ§ "ÃöÁä¦r"

Excel ´M§ä ¦hµ§ "ÃöÁä¦r"

Dear ¦U¦ì¤j¤j¡A

§Ú·Q½Ð°Ý Excel ±`¥ÎªºCtrl +F ªº´M§ä¤Î¨ú¥N¥\¯à¡C

¦³¨S¦³¿ìªk¦P®É¿é¤J¨â­Óor¥H¤Wªº"ÃöÁä¦r"Åý Excel ·j´M©O?

ÁÂÁ¦U¦ì¤j¤j!

¥ý§ä¤@¦¸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)
À´±oµo°Ý,µª®×´N·|¦b¨ä¤¤

¤µ¤éの¤@¬íは  ©ú¤éにない
http://kimbalko-chi.blogspot.com
http://kimbalko.blogspot.com

TOP

¦^´_ 2# kimbal


    Dear ¤j¤j¡A
ÁÂÁ±z¡A¨Ï¥Î¤W¦³¨Ç°ÝÃD·Q½Ð±Ð¡C
°õ¦æ¥¨¶°·|¥X²{¿ù»~¡A°»¿ù¦b³Ì«á¤@¦æ "msgbox(finalresult.Address)"

½Ð¤£§[«ü±Ð~ ·P®¦ªü~

TOP

¬O§ä¤£¨ìªº·N«ä, ¥i¥H¦h¥[¤@­ÓIF¸õ¹L:
IF not finalresult is nothing then
msgbox(finalresult.Address)
end if
À´±oµo°Ý,µª®×´N·|¦b¨ä¤¤

¤µ¤éの¤@¬íは  ©ú¤éにない
http://kimbalko-chi.blogspot.com
http://kimbalko.blogspot.com

TOP

        ÀR«ä¦Û¦b : ¸Ü¦h¤£¦p¸Ü¤Ö¡A¸Ü¤Ö¤£¦p¸Ü¦n¡C
ªð¦^¦Cªí ¤W¤@¥DÃD