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

[µo°Ý] ¤£¦PÄæ¦ì¤¤¼Æ¦rªº¤ñ¹ï

[µo°Ý] ¤£¦PÄæ¦ì¤¤¼Æ¦rªº¤ñ¹ï

¤µ¤Ñ¦b¤u§@¤¤±µ¨ì¤@­Ó¥O§Ú·Q¤£¥X¿ìªkªºÃøÃD¡A¤£ª¾¬O§_¦³¤H¯à´£¨Ñ¦n¤èªk

°ÝÃD¬O³o¼Ëªº¡C

¦b¨â­Ó¤£¦PÄæ¦ì¤¤¦³¨â²Õªø«×¤£¦Pªº¼Æ¦r¡A¥i¬O§Ú¥u·Q¤ñ¹ï¨â²Õ¼Æ¦r¤¤ªº¬Y¨â­Ó¼Æ¦r

¨Ò¦p¡G30020150000,04HE15-100¡C

³o¨â­ÓÄæ¦ì¤¤ªº¼Æ¦rªø«×¤£¦P¡A¦ý§Ú¥u·Q¤ñ¹ï¼Ð°O¬õ¦âªº¼Æ¦r¬O§_¬Û¦P¡A­Y¤£¦P«h¼Æ¦r¤Ï¬õ

½Ð±Ð¦U¦ì¡A¦³³o¼Ëªº¤½¦¡¥i¼g¶Ü¡H

¥»©«³Ì«á¥Ñ luhpro ©ó 2014-9-6 03:28 ½s¿è
¤µ¤Ñ¦b¤u§@¤¤±µ¨ì¤@­Ó¥O§Ú·Q¤£¥X¿ìªkªºÃøÃD¡A¤£ª¾¬O§_¦³¤H¯à´£¨Ñ¦n¤èªk

½Ð±Ð¦U¦ì¡A¦³³o¼Ëªº¤½¦¡¥i¼g¶Ü¡H
kyotogoeric µoªí©ó 2014-9-4 21:12

­Y·Q­n²{¦¨ªº¨S¦³,
¦]¬° Excel ¨t²Î¦Û±aªº¤½¦¡¨ä§@¥Î¥DÅ鬰 "Àx¦s®æ", ¨S¦³°w¹ï¨ä¤º­Ó§O¤å¼Æ¦r°µ³B²zªº¤½¦¡.

¤£¹L¥i¥H¦Û¤v°µ¤@­Ó :  ©³¤U¨ç¼Æ¨Ï¥Îªº¤è¦¡¬° :  =CompNumber(A1,B1) , ¶Ç¦^­È¬°¥¬ªL­È
  1. Function CompNumber(rng1 As Range, rng2 As Range) As Boolean
  2.   Dim iNum1%, iNum2%, iPos%, iLen%
  3.   Dim rTar As Range
  4.   
  5.   CompNumber = False
  6.   Set rTar = rng1
  7.   iLen = Len(rTar)
  8.   For iPos = 1 To iLen
  9.     With rTar.Characters(Start:=iPos, Length:=2).Font
  10.       If .ColorIndex = 3 Then Exit For
  11.     End With
  12.   Next
  13.   If iPos <> iLen Then
  14.     iNum1 = CInt(Mid(rTar, iPos, 2))
  15.   Else
  16.     Exit Function
  17.   End If
  18.   
  19.   Set rTar = rng2
  20.   iLen = Len(rTar)
  21.   For iPos = 1 To iLen
  22.     With rTar.Characters(Start:=iPos, Length:=2).Font
  23.       If .ColorIndex = 3 Then Exit For
  24.     End With
  25.   Next
  26.   If iPos <> iLen Then
  27.     iNum2 = CInt(Mid(rTar, iPos, 2))
  28.   Else
  29.     Exit Function
  30.   End If
  31.   
  32.   If iNum1 = iNum2 Then CompNumber = True
  33. End Function
½Æ»s¥N½X
¦Ó­Y·Q·í¤ñ¹ï¤£²Å´Nª½±µ±N¤å¦rÅܬ°¬õ¦â :
  1. Private Sub cbComp_Click()
  2.   ChkNum [A1], [B1]
  3. End Sub

  4. Sub ChkNum(rng1 As Range, rng2 As Range)
  5.   Dim iNum1%, iNum2%, iPos%, iLen%
  6.   Dim lRow&
  7.   Dim rTar As Range
  8.   
  9.   Set rTar = rng1
  10.   lRow = 0
  11.   While rng1.Offset(lRow) <> ""
  12.     iLen = Len(rTar)
  13.     For iPos = 1 To iLen
  14.       With rTar.Characters(Start:=iPos, Length:=2).Font
  15.         If .ColorIndex = 3 Then Exit For
  16.       End With
  17.     Next
  18.     If iPos <> iLen Then
  19.       iNum1 = CInt(Mid(rTar, iPos, 2))
  20.     Else
  21.       Exit Sub
  22.     End If
  23.   
  24.     Set rTar = rng2.Offset(lRow)
  25.     iLen = Len(rTar)
  26.     For iPos = 1 To iLen
  27.       With rTar.Characters(Start:=iPos, Length:=2).Font
  28.         If .ColorIndex = 3 Then Exit For
  29.       End With
  30.     Next
  31.     If iPos <> iLen Then
  32.       iNum2 = CInt(Mid(rTar, iPos, 2))
  33.     Else
  34.       Exit Sub
  35.     End If
  36.   
  37.     If iNum1 <> iNum2 Then
  38.       rng1.Offset(lRow).Font.ColorIndex = 3
  39.       rng2.Offset(lRow).Font.ColorIndex = 3
  40.     End If
  41.     lRow = lRow + 1
  42.     Set rTar = rng1.Offset(lRow)
  43.   Wend
  44. End Sub
½Æ»s¥N½X
¼Æ¦r¤ñ¹ï-a.zip (12.46 KB)

TOP

·PÁ¦^ÂÐ

§Ú­n¬ã¨s¤@¤U¡A¦]¬°§Ú¬Oªì¾ÇªÌ¡AÁÙ¤£ª¾¹D«ç»ò±N¤W­zªº¦Û»s¤½¦¡±a¤J§Úªºexcel¤º

TOP

°£¤FVBA§Ú³o´X¤Ñ¤]§Q¥Î¨ç¼Æ°µ¤F¤@­Ó²³æªº¤ñ¹ï¤è¦¡¡A¤]¬O¥i¥H¤ñ¸û¥XÄæ¦ì¤¤¨âÄæ¦ì¼Æ¦r¬O§_¬Û¦P

IF(RIGHT(LEFT(Äæ¦ì,¦Û¥ªÃäºâ¼Æ¦rªø«×),¤ñ¹ï¼Æ¦r)=RIGHT(Äæ¦ì,¦Û¥ªÃäºâ¼Æ¦rªø«×),¤ñ¹ï¼Æ¦r),"ok","NG")

TOP

¦^´_ 4# kyotogoeric

¨Ò¦p¡G30020150000,04HE15-100¡C

³o¨â­ÓÄæ¦ì¤¤ªº¼Æ¦rªø«×¤£¦P¡A¦ý§Ú¥u·Q¤ñ¹ï¼Ð°O¬õ¦âªº¼Æ¦r¬O§_¬Û¦P¡A­Y¤£¦P«h¼Æ¦r¤Ï¬õ


1. ¸ê®Æ¤Î³W«h»¡©ú¤Ó¤Ö¡A­Y¥H¥Ø«e¨Ó¬Ý
A1 30020150000
B1  04HE15-100
C1 ¤½¦¡ =IF(MID(A1,6,2)=MID(B1,5,2),"¦P","¤£¦P")

¼Ð°O¬õ¦â¡A¥i¥H¥Î ³]©w®æ¦¡¤Æ±ø¥ó¨Ó¼Ð¥Ü(¾ã­ÓÀx¦s®æ¥ÎÃC¦â´£¿ô)
³]©w¤½¦¡ =MID($A1,6,2)<>MID($B1,5,2)
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

        ÀR«ä¦Û¦b : ­n¤ñ½Ö§ó¨ü½Ö¡D¤£­n¤ñ½Ö§ó©È½Ö¡C
ªð¦^¦Cªí ¤W¤@¥DÃD