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

§ä¥Xrow©Mcol°ÝÃD

§ä¥Xrow©Mcol°ÝÃD

½Ð°Ý¤j¤j¦p¦ó §ä¥X A1:C5,E6:G10,A11:C15 ¥u¦³1­ÓÀx¦s®æªº­È¬O1ªº´N§ä¥X¥¦ªºrow©Mcol.
i1=row
j1=col
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

¦^´_ 1# basarasy
  1. Sub nn()
  2. For Each a In Range("A1:C5,E6:G10,A11:C15 ")
  3.   If a = 1 Then i1 = a.Row: j1 = a.Column: Exit For
  4. Next
  5. MsgBox i1 & "    " & j1
  6. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 2# Hsieh

ÁÂÁ¤j¤j.
¦ý§Ú¬O·Q­n³o­Ó.
½Ð°Ý¤j¤j³o­Ó¥i¥H¤Æ²¶Ü?
  1. Sub nn()
  2. b = 0
  3. For Each a In Range("A1:C5,E6:G10,A11:C15 ")
  4. b = b + WorksheetFunction.CountIf(a, 1)
  5. Next

  6. If b = 1 Then
  7. For Each a In Range("A1:C5,E6:G10,A11:C15 ")
  8.   If a = 1 Then i1 = a.Row: j1 = a.Column: Exit For
  9. Next
  10. End If

  11. MsgBox i1 & "    " & j1

  12. End Sub
½Æ»s¥N½X
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¥»©«³Ì«á¥Ñ Hsieh ©ó 2010-10-29 19:43 ½s¿è
  1. Sub nn()
  2. If WorksheetFunction.CountIf( Range("A1:C5,E6:G10,A11:C15 "), 1) = 1 Then
  3. For Each a In Range("A1:C5,E6:G10,A11:C15 ")
  4.   If a = 1 Then i1 = a.Row: j1 = a.Column: Exit For
  5. Next
  6. End If

  7. MsgBox i1 & "    " & j1

  8. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

Sub Ex()
    Dim Rng As Range
    Set Rng = Range("A1:C5,E6:G10,A11:C15").Find(1)
    If Not Rng Is Nothing Then MsgBox "Row " & Rng.Row & " , Column " & Rng.Column
End Sub

TOP

¦^´_ 5# GBKEE


    ¥[¤J°Ñ¼Æ·|¦n¤@ÂI
    Set Rng = Range("A1:C5,E6:G10,A11:C15").Find(1, lookat:=xlWhole)
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥ýÁÂÁÂ2¦ì¤j¤j.
¦ý§Ú·Q§äªº¬O,¦bA1:C5,E6:G10,A11:C15 ¥u¦³1­ÓÀx¦s®æªº­È¬O1ªº¼Æ,¦h¹L1­ÓÀx¦s®æªº­È¬O1ªº´N
¤£¥XMSGBOX.
¼Æ­È1¬OÅܼÆ.
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¦^´_ 7# basarasy
¬O³o¼Ë¶Ü?
  1. Sub Ex()
  2.     Dim X, E As Range, i%, Rng As Range
  3.     X = 1  'X-> ¼Æ­ÈªºÅܼÆ
  4.     For Each E In Range("A1:C5,E6:G10,A11:C15")
  5.         If E = X Then
  6.             i = i + 1
  7.             Set Rng = E
  8.             If i >= 2 Then Exit For
  9.         End If
  10.     Next
  11.     If i = 1 Then MsgBox "Row " & Rng.Row & " , Column " & Rng.Column
  12. End Sub
½Æ»s¥N½X

TOP

¦^´_ 8# GBKEE
¬O³o­Ó¤F.
«D±`·PÁÂGBKEE¤j¤j.
ÁÙ¦³­Ó¤p°ÝÃD¬O¦p¦ó1¦¸¹L§â©Ò¦³ªº ÅܼÆ=Nothing?
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¦^´_ 9# basarasy
¦p¦ó1¦¸¹L§â©Ò¦³ªº ÅܼÆ=Nothing?
¥i¥H¦A»¡©ú¥Õ¨Ç¶Ü?

TOP

        ÀR«ä¦Û¦b : §ïÅܦۤv¬O¦Û±Ï¡A¼vÅT§O¤H¬O±Ï¤H¡C
ªð¦^¦Cªí ¤W¤@¥DÃD