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

[¤w¸Ñ¨M][µo°Ý]µ{¦¡Â²¤Æ-°}¦C-VBA ¡A´M§ä¬Y¤¸¯À¬O§_¦s¦b°}¦C¤¤¡C

[¤w¸Ñ¨M][µo°Ý]µ{¦¡Â²¤Æ-°}¦C-VBA ¡A´M§ä¬Y¤¸¯À¬O§_¦s¦b°}¦C¤¤¡C

¥»©«³Ì«á¥Ñ Baracuda ©ó 2011-4-7 09:24 ½s¿è
  1. Option Explicit
  2. Option Base 1

  3. Dim Input_No  As Integer, Output_No As Integer
  4. Dim Output_Sht_Name_Ary, Input_Sht_Name_Ary

  5. Sub initial()
  6.     Input_Sht_Name_Ary = Array("¤@", "¤­", "¤K")
  7.     Output_Sht_Name_Ary = Array("¤@", "¤G", "¤T", "¥|", "¤­", "¤»")

  8.     Input_No = UBound(Input_Sht_Name_Ary)
  9.     Output_No = UBound(Output_Sht_Name_Ary)

  10. End Sub

  11. Sub main()

  12.    Call initial
  13.    Call Print_Not_Found

  14. End Sub


  15. Sub Print_Not_Found()
  16. Dim Sht_Cnt As Integer
  17. Dim Ctr_1 As Integer, Ctr_2 As Integer
  18. Dim Found_Or_Not As Boolean
  19.    
  20.     Found_Or_Not = False
  21.    
  22.     For Ctr_1 = 1 To Input_No
  23.         
  24.         For Ctr_2 = 1 To Output_No
  25.             If Input_Sht_Name_Ary(Ctr_1) = Output_Sht_Name_Ary(Ctr_2) Then
  26.                 Found_Or_Not = True
  27.                 Exit For
  28.             End If
  29.         Next Ctr_2
  30.         If Not (Found_Or_Not) Then
  31.             Debug.Print Input_Sht_Name_Ary(Ctr_1)
  32.         End If
  33.         
  34.         Found_Or_Not = False
  35.     Next Ctr_1

  36. End Sub
½Æ»s¥N½X

¦^´_ 16# ssooi


¥i¥H¨Ï¥Î APPLICATION.MATCH
°}¦C¼Æ¶q¤j  ¦r¨å--ITEM°O¿ý¦ì¸m

TOP

¥»©«³Ì«á¥Ñ °a¤ªºµ ©ó 2020-8-12 20:10 ½s¿è

³o¼Ë¦n¹³¤]¥i¥H
  1. Sub ½m²ßÅã¥Ü°}¦C¦ì¸m()

  2. Dim A, B, i, k

  3. A = Array("¤@", "¤­", "¤K")
  4. B = Array("¤@", "¤G", "¤T", "¥|", "¤­", "¤»")

  5.     For i = 0 To UBound(B)
  6.         If A(k) = B(i) Then
  7.            MsgBox " Aªº " & A(k) & " ¦b B ªº ²Ä " & i & " ­Ó"
  8.            If k <= UBound(A) Then k = k + 1
  9.         Else
  10.            MsgBox " B ªº ²Ä " & i & " ­Ó" & " ¬O " & B(i)
  11.         End If
  12.     Next i
  13.    
  14. End Sub
½Æ»s¥N½X

TOP

¦^´_ 3# chin15
  1. a = Array("¤@", "¤­", "¤K")
  2.    b = Array("¤@", "¤G", "¤T", "¥|", "¤­", "¤»")
  3. For i = 0 To UBound(a)
  4. If UBound(Filter(b, a(i))) = -1 Then
  5. MsgBox "¤£ ¥]§t" & a(i)
  6. Else
  7. MsgBox "¥]§t" & a(i)
  8. End If
  9. Next
½Æ»s¥N½X
½Ð°Ý¸Ó«ç»ò¼Ë°µ¤~¯à¶i¤@¨BÅã¥ÜA¬O¦s¦bB°}¦Cªº²Ä´X­Ó¯Á¤Þ­È©O?
ÁÂÁÂ

TOP

¦^´_ 14# GBKEE

«D±`·PÁÂGBKEE«e½ú¸Ô²Ó¸Ñ»¡,
­ì¨Ó°ÝÃD¥X¦b¤@ºû°}¦C,¤p§Ì¦A¬ã¨s¬Ý¬Ý.

TOP

¦^´_ 13# greetingsfromtw
  1. '°Q½×°Ïºô§}:http://forum.twbts.com/index.php
  2. Option Explicit
  3. Sub Ex()
  4.     Dim M As Variant, A(), B()
  5.     A = Range("a2:a" & Cells(Rows.Count, 1).End(xlUp).Row)  '¤Gºû°}¦C
  6.     B = Range("b2:b" & Cells(Rows.Count, 2).End(xlUp).Row) '¤Gºû°}¦C
  7.     B = Application.WorksheetFunction.Transpose(B)                'Âà¦Ü¬°¤@ºû°}¦C
  8.     For Each E In A
  9.         M = Application.Match(E, B, 0)
  10.         MsgBox E & IIf(IsNumeric(M), "¦s¦b©ó ", " ¤£¦s¦b©ó ") & Join(B, ",")
  11.         'Join ¨ç¼Æ ¶Ç¦^¤@­Ó¦r¦ê¡A¸Ó¦r¦ê¬O³z¹L³sµ²¬Y­Ó°}¦C¤¤ªº¦h­Ó¤l¦r¦ê¦Ó«Ø¥ßªº¡C
  12.         '******** ¬Y­Ó°}¦C ,¥²¶·¬O¤@ºû°}¦C********************
  13.     Next
  14. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 5# GBKEE

GBKEE«e½ú¦n,«_¬N¥´ÂZ,

·PÁ´£¨Ñµ{¦¡½X,
¤p§Ì¦³¸ÕµÛ­×§ï«e½úªºµ{¦¡½X,
¸Õ¹Ï±NÀx¦s®æ¤ºªº­È°µ¬°¤¸¯ÀÀx¦Ü°}¦C¤¤,¦ý¬O·|¥X²{¿ù»~,¤£ª¾¦p¦ó¸Ñ¨M,

¤p§Ì¤æÁx,¬O§_¯à°÷³Â·Ð«e½ú«üÂI°g¬z,¤Q¤À·PÁÂ.

ªþ¤WÀɮפέקï¦Û«e½ú©Ò¼gµ{¦¡½X:
  1. '¦¹µ{¦¡½X­×§ï¦Û³Â»¶®a±Ú°Q½×°Ïexcel°ª¤âGBKEE«e½ú©Ò¼g,«D§Ú¦Û³Ð.
  2. '°Q½×°Ïºô§}:http://forum.twbts.com/index.php
  3. Sub Ex()
  4.     A = Range("a2:a" & Cells(Rows.Count, 1).End(xlUp).Row)
  5.     b = Range("b2:b" & Cells(Rows.Count, 2).End(xlUp).Row)
  6.     For Each E In A
  7.         M = Application.Match(E, b, 0)
  8.         MsgBox E & IIf(IsNumeric(M), "¦s¦b©ó ", " ¤£¦s¦b©ó ") & Join(b, ",")
  9.     Next
  10. End Sub
½Æ»s¥N½X
20161026-°}¦C·j´M¯S©w¦r¦ê°ÝÃD.zip (9.06 KB)

TOP

¦^´_ 12# Baracuda
­n«ö¤U ¦p¹Ïªº¥N½X ±Nµ{¦¡½X¶K¤W «á«ö´£¥æ


TOP

chin15 ÁÂÁ¡C±q§A¦^µªªº°ÝÃD¡Aı±o§A¬O±j¤â¡A¤w¸g±q¤p¾Ç¥ÍÂର¤¤¾Ç¥Í¤F¡AÁÂÁ¡Cµ{«×¥»¨Ó´N¤£À³¸Ó¬O¤p¾Ç¥Í¡C

TOP

ÁÂÁ GBKEE¡A§Ú¤]¬O¥ý³o¼Ë³]©wÅܼƫ¬ºA¡C
¥u¬O§Ú©È¤Ó¹L©ó¯Ó¨t²Î¸ê·½(ÁöµM²{¦bªº¨t²Î¸ê·½³£ÁÙ¦n)¡A¦ý¬O¬°¾i¦¨¦n²ßºD¡AÁÙ¬O¥­±`´N¬ÙµÛÂI¥Î¡C

TOP

        ÀR«ä¦Û¦b : ¬°¦Û¤v§äÂǤfªº¤H¥Ã»·¤£·|¶i¨B¡C
ªð¦^¦Cªí ¤W¤@¥DÃD