- ©«¤l
- 835
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 915
- ÂI¦W
- 15
- §@·~¨t²Î
- Win 10,7
- ³nÅ骩¥»
- 2019,2013,2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-3
- ³Ì«áµn¿ý
- 2024-11-12
|
¥»©«³Ì«á¥Ñ 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·Qn²{¦¨ªº¨S¦³,
¦]¬° Excel ¨t²Î¦Û±aªº¤½¦¡¨ä§@¥Î¥DÅ鬰 "Àx¦s®æ", ¨S¦³°w¹ï¨ä¤ºÓ§O¤å¼Æ¦r°µ³B²zªº¤½¦¡.
¤£¹L¥i¥H¦Û¤v°µ¤@Ó : ©³¤U¨ç¼Æ¨Ï¥Îªº¤è¦¡¬° : =CompNumber(A1,B1) , ¶Ç¦^Ȭ°¥¬ªLÈ- Function CompNumber(rng1 As Range, rng2 As Range) As Boolean
- Dim iNum1%, iNum2%, iPos%, iLen%
- Dim rTar As Range
-
- CompNumber = False
- Set rTar = rng1
- iLen = Len(rTar)
- For iPos = 1 To iLen
- With rTar.Characters(Start:=iPos, Length:=2).Font
- If .ColorIndex = 3 Then Exit For
- End With
- Next
- If iPos <> iLen Then
- iNum1 = CInt(Mid(rTar, iPos, 2))
- Else
- Exit Function
- End If
-
- Set rTar = rng2
- iLen = Len(rTar)
- For iPos = 1 To iLen
- With rTar.Characters(Start:=iPos, Length:=2).Font
- If .ColorIndex = 3 Then Exit For
- End With
- Next
- If iPos <> iLen Then
- iNum2 = CInt(Mid(rTar, iPos, 2))
- Else
- Exit Function
- End If
-
- If iNum1 = iNum2 Then CompNumber = True
- End Function
½Æ»s¥N½X ¦ÓY·Q·í¤ñ¹ï¤£²Å´Nª½±µ±N¤å¦rÅܬ°¬õ¦â :- Private Sub cbComp_Click()
- ChkNum [A1], [B1]
- End Sub
- Sub ChkNum(rng1 As Range, rng2 As Range)
- Dim iNum1%, iNum2%, iPos%, iLen%
- Dim lRow&
- Dim rTar As Range
-
- Set rTar = rng1
- lRow = 0
- While rng1.Offset(lRow) <> ""
- iLen = Len(rTar)
- For iPos = 1 To iLen
- With rTar.Characters(Start:=iPos, Length:=2).Font
- If .ColorIndex = 3 Then Exit For
- End With
- Next
- If iPos <> iLen Then
- iNum1 = CInt(Mid(rTar, iPos, 2))
- Else
- Exit Sub
- End If
-
- Set rTar = rng2.Offset(lRow)
- iLen = Len(rTar)
- For iPos = 1 To iLen
- With rTar.Characters(Start:=iPos, Length:=2).Font
- If .ColorIndex = 3 Then Exit For
- End With
- Next
- If iPos <> iLen Then
- iNum2 = CInt(Mid(rTar, iPos, 2))
- Else
- Exit Sub
- End If
-
- If iNum1 <> iNum2 Then
- rng1.Offset(lRow).Font.ColorIndex = 3
- rng2.Offset(lRow).Font.ColorIndex = 3
- End If
- lRow = lRow + 1
- Set rTar = rng1.Offset(lRow)
- Wend
- End Sub
½Æ»s¥N½X
¼Æ¦r¤ñ¹ï-a.zip (12.46 KB)
|
|