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

[µo°Ý] §R°£¬¡­¶Ã¯¸ê®Æ´NµLªk°õ¦æVBA¡A¥X²{¨S¦³³]©wª«¥óÅܼƩÎWITH°Ï¶ôÅܼÆ

¥»©«³Ì«á¥Ñ kimbal ©ó 2010-7-22 18:42 ½s¿è
¦U¦ì«e½ú¦n¡I
§Ú¼g¤F¤@­Óµ{¦¡¡AµM«á¬¡­¶Ã¯ªº¸ê®Æ«h¬O§Ú¦Û¤v¥ý¶Ã¿é¤J®³¨Ó´ú¸Õµ{¦¡¬O§_¶¶§Q¥Îªº¡A´N¦b§Ú²×©ó ...
wiemanson µoªí©ó 2010-7-22 17:37



sheet1¦pªG¨S¦³ ªL, ¤O, 4  ªº¤º®e´N·|¦º±¼

Cells.Find(What:="ªL", After:=ActiveCell) ³o¨Ç, ¦pªG§ä¤£¨ì®æ¤l, ´N·|¦^¶Çnothing
³o­Ó®É­Ô, if Cells(x, 1) = nothing then ´N·|¦º±¼
  1. Sub s1()
  2. Worksheets("Sheet1").Select
  3.   x = 1
  4.    Do
  5.       If Cells(x, 1) = "" Then
  6.         Exit Do
  7.       Else
  8.         y1 = Cells.Find(What:="ªL", After:=ActiveCell)
  9.         If y1 Is Nothing Then
  10.             y1s = "NOTHING"
  11.         Else
  12.             y1s = y1.Value
  13.         End If
  14.         y2 = Cells.Find(What:="4", After:=ActiveCell)
  15.         If y2 Is Nothing Then
  16.             y2s = "NOTHING"
  17.         Else
  18.             y2s = y2.Value
  19.         End If
  20.         y3 = Cells.Find(What:="¤O", After:=ActiveCell)
  21.         If y3 Is Nothing Then
  22.             y3s = "NOTHING"
  23.         Else
  24.             y3s = y3.Value
  25.         End If

  26.         
  27.         If Cells(x, 1) = y1s And Cells(x, 3) = y2s And Cells(x, 4) = "´¶³q" And Cells(x, 6) = "§_" Then
  28.          Cells(x, 7) = 23 * Cells(x, 5)
  29.         ElseIf Cells(x, 1) = y1s And Cells(x, 4) = "¦n" And Cells(x, 6) = "§_" Then
  30.          Cells(x, 7) = 20 * Cells(x, 5)
  31.         ElseIf Cells(x, 1) = y1s And Cells(x, 4) = "¤£¦n" And Cells(x, 5) <= 20 And Cells(x, 6) = "§_" Then
  32.          Cells(x, 7) = 300
  33.         ElseIf Cells(x, 1) = y1s And Cells(x, 6) = "§_" And Cells(x, 4) = "¨ä¥¦" Then
  34.         Cells(x, 7) = "¥t¥~ºâ"
  35.         ElseIf Cells(x, 1) = y3s And Cells(x, 4) = "¦n" And Cells(x, 6) = "§_" Then
  36.          Cells(x, 7) = 10 * Cells(x, 5)
  37.         ElseIf Cells(x, 1) = y3s And Cells(x, 4) = "¤£¦n" And Cells(x, 6) = "§_" Then
  38.          Cells(x, 7) = 2 * Cells(x, 5)
  39.         ElseIf Cells(x, 1) = y3s And Cells(x, 4) = "´¶³q" And Cells(x, 5) <= 20 And Cells(x, 6) = "§_" Then
  40.          Cells(x, 7) = 300
  41.         ElseIf Cells(x, 1) = y3s And Cells(x, 6) = "§_" And Cells(x, 4) = "¨ä¥¦" Then
  42.         Cells(x, 7) = "¥t¥~ºâ"
  43.         End If
  44.    
  45.          
  46.      End If
  47.          
  48.     x = x + 1
  49.     Loop
  50.                   
  51.      
  52. End Sub
½Æ»s¥N½X
À´±oµo°Ý,µª®×´N·|¦b¨ä¤¤

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

TOP

¦^´_  kimbal


  ¦ý¬O§Ú¥¿¦¡ªº¬¡­¶Ã¯¸ê®Æ¤¤¡A³£¦³§Ú¦bµ{¦¡¸Ì­±©Ò­n¤ñ¹ïªº¦r¤¸¡I¡I

§Úªº¸ê®Æªí¥D­n¬O ...
wiemanson µoªí©ó 2010-7-22 19:34



   ¥Î2¼Ó´£¨Ñªº¥N½X¨S°ÝÃD¶Ü?
À´±oµo°Ý,µª®×´N·|¦b¨ä¤¤

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

TOP

¦^´_  kimbal


    ¥ýÁÂÁ«e½ú¼ö¤ß«ü¾É¡A§Úª½±µ§âÀÉ®×¥á¤W¨Ó¦n¤F¡I
wiemanson µoªí©ó 2010-7-22 21:16



   ¥¿¦p¤W­±©Ò»¡,¨S¦³ "¥h²B", ©Ò¥H¦º±¼°Õ~
¶K¤W³o­Ó¦A¸Õ¸Õ¹B¤@¤U
  1. Sub s1()

  2. Worksheets("Sheet1").Select
  3.   x = 1
  4.    Do
  5.       If Cells(x, 1) = "" Then
  6.         Exit Do
  7.         End If
  8.         Set y1 = Cells.Find(What:="¤T¸s", After:=ActiveCell)
  9.         If y1 Is Nothing Then
  10.             y1 = ""
  11.         End If
  12.         Set y2 = Cells.Find(What:="¥h²B", After:=ActiveCell)
  13.         If y2 Is Nothing Then
  14.             y2 = ""
  15.         End If
  16.         Set y3 = Cells.Find(What:="ª÷µo", After:=ActiveCell)
  17.         If y3 Is Nothing Then
  18.             y3 = ""
  19.         End If
  20.         Set y4 = Cells.Find(What:="«p", After:=ActiveCell)
  21.         If y4 Is Nothing Then
  22.             y4 = ""
  23.         End If
  24.         If Cells(x, 1) = y1 And Cells(x, 3) = y2 And Cells(x, 4) = "Âì" And Cells(x, 6) = "§_" Then
  25.          Cells(x, 7) = 11 * Cells(x, 5)
  26.         ElseIf Cells(x, 1) = y1 And Cells(x, 3) = y4 And Cells(x, 4) = "Âì" And Cells(x, 6) = "§_" Then
  27.          Cells(x, 7) = 2 * Cells(x, 5)
  28.         ElseIf Cells(x, 1) = y1 And Cells(x, 4) = "Âì" And Cells(x, 6) = "§_" Then
  29.          Cells(x, 7) = 5 * Cells(x, 5)
  30.         ElseIf Cells(x, 1) = y1 And Cells(x, 4) = "»Ì" And Cells(x, 6) = "§_" Then
  31.          Cells(x, 7) = 45 * Cells(x, 5)
  32.         ElseIf Cells(x, 1) = y1 And Cells(x, 4) = "«C»É" And Cells(x, 6) = "§_" Then
  33.          Cells(x, 7) = 12 * Cells(x, 5)
  34.         ElseIf Cells(x, 1) = y1 And Cells(x, 4) = "Âì" And Cells(x, 5) <= 20 And Cells(x, 6) = "§_" Then
  35.          Cells(x, 7) = "·r°u"
  36.         ElseIf Cells(x, 1) = y1 And Cells(x, 6) = "§_" And Cells(x, 4) = "¨ä¥¦" Then
  37.         Cells(x, 7) = "¥t¥~ºâ"
  38.    
  39.    
  40.         ElseIf Cells(x, 1) = y3 And Cells(x, 3) = Cells.Find(What:="(3mm)", After:=ActiveCell) And Cells(x, 4) = "Âì" And Cells(x, 6) = "§_" Then
  41.          Cells(x, 7) = "¤p¤ä"
  42.         ElseIf Cells(x, 1) = y3 And Cells(x, 4) = "Âì" And Cells(x, 6) = "§_" Then
  43.          Cells(x, 7) = 10 * Cells(x, 5)
  44.         ElseIf Cells(x, 1) = y3 And Cells(x, 4) = "»Ì" And Cells(x, 6) = "§_" Then
  45.          Cells(x, 7) = 2 * Cells(x, 5)
  46.         ElseIf Cells(x, 1) = y3 And Cells(x, 4) = "Âì" And Cells(x, 5) <= 20 And Cells(x, 6) = "§_" Then
  47.          Cells(x, 7) = 40
  48.         ElseIf Cells(x, 1) = y3 And Cells(x, 6) = "§_" And Cells(x, 4) = "¨ä¥¦" Then
  49.         Cells(x, 7) = "¥t¥~ºâ"
  50.         
  51.         Else
  52.             
  53.         Cells(x, 7) = 0

  54.      
  55.         End If
  56.          
  57.          
  58.          
  59.     x = x + 1
  60.     Loop

  61.   End Sub
½Æ»s¥N½X
À´±oµo°Ý,µª®×´N·|¦b¨ä¤¤

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

TOP

        ÀR«ä¦Û¦b : ª¾ÃÑ­n¥Î¤ßÅé·|¡A¤~¯àÅܦ¨¦Û¤vªº´¼¼z¡C
ªð¦^¦Cªí ¤W¤@¥DÃD