ªð¦^¦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

µ{¦¡ªº­ì©l½X¦p¤W¡G
²{¦b¬O¥Î2 ­Ó廻°é¦b´M§ä¬O§_ Input ªº Element ¦³¦s¦b Output ªº Array ¤¤¡C
·Q½Ð°Ý¦³µL¸û²¼äªº»yªk¥i¥H¸Ñ¨M¡C

¨Ì·Ó²{¦bªºµ{¦¡¥i¥H§ä¥X "¤K"¬O¤£¦b Array Output ¤§¤¤¡C

TOP

a = Array("¤@", "¤­", "¤K")
   b = Array("¤@", "¤G", "¤T", "¥|", "¤­", "¤»")
For i = 0 To UBound(a)
If UBound(Filter(b, a(i))) = -1 Then
MsgBox "¤£ ¥]§t" & a(i)
Else
MsgBox "¥]§t" & a(i)
End If
Next

TOP

chin15 ªº¤èªk¤ñ§Úªº¦³®Ä²v¡C
¤Ö¤F¤@­Ó Loop ¡C
³o¼Ëªºµ{¦¡¤]¤ñ¸û²µu¡C
¦pªGÁÙ¦³§Oªº¤è¦¡¡A½Ð¦U¦ì¤j­ô¤j©j¦AÀ°¦£¤@¤U¡C

TOP

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

¦^´_ 4# Baracuda
  1. Sub Ex()
  2.     A = Array("¤@", "¤­", "¤K")
  3.     b = Array("¤@", "¤G", "¤T", "¥|", "¤­", "¤»")
  4.     For Each E In A
  5.         M = Application.Match(E, b, 0)
  6.         MsgBox E & IIf(IsNumeric(M), "¦s¦b©ó ", " ¤£¦s¦b©ó ") & Join(b, ",")
  7.     Next
  8. End Sub
½Æ»s¥N½X

TOP

GBKEE ÁÂÁ¡C
³o­Óµ{¦¡ Work
½Ð°Ý¤@¤UÅܼƪº«¬ºA
E & M ¦U¬°¦óºØ«¬ºA¡C§Ú²{¦b¬O³]¦¨ Variant
E ³]¦¨ String ¤£·|work¡C
½Ð½ç±Ð¤@¤U¡C

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-3-30 14:31 ½s¿è

¦^´_ 6# Baracuda
°j°é  FOR EACH E  IN ª«¥ó    Eªº«¬ºA¬OVariant  ©Î  Object
¦p  ª«¥ó¬O Range ½d³ò             Eªº«¬ºA¥i³]¬° Range
M = Application.Match(E, b, 0)  ¶Ç¦^ ¼Æ¦r ©Î #NA
M ªº«¬ºA ¬O  Variant

TOP

¥i¥H¥ÎTypeName ¨ç¼Æ¨ú±oÅܼÆÃþ«¬
MsgBox TypeName(M)

TOP

6¼Ó °Ý E ³]¦¨ String ¤£·|work¡C
³o¬O«Å§i «¬ºAªº°ÝÃD

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 : ¬O«D·í±Ð¨|¡AÆg¬ü§@ĵ±§¡C
ªð¦^¦Cªí ¤W¤@¥DÃD