我给的方法是用宏,打开你的表格,我假设你的数字放在A列,且是三位数字,按ALT + F11,双击左面的“SHEET1(你的表名)”,粘贴如下代码后,按F5,
Sub Choose()
Dim i As Integer
i = i + 1
For i = 2 To 500
Dim lft1 As String
Dim mid1 As String
Dim rit1 As String
lft1 = Left(Sheets(1).Cells(i, 1).Value, 1)
mid1 = Right(Left(Sheets(1).Cells(i, 1).Value, 2), 1)
rit1 = Right(Sheets(1).Cells(i, 1).Value, 1)
If Sheets(1).Cells(i, 1).Value <> "" And lft1 = mid1 Then
Sheets(1).Cells(i, 1).Select
With Selection.Font
.Color = -16776961
.TintAndShade = 0
End With
End If
If Sheets(1).Cells(i, 1).Value <> "" And lft1 = rit1 Then
Sheets(1).Cells(i, 1).Select
With Selection.Font
.Color = -16776961
.TintAndShade = 0
End With
End If
If Sheets(1).Cells(i, 1).Value <> "" And mid1 = rit1 Then
Sheets(1).Cells(i, 1).Select
With Selection.Font
.Color = -16776961
.TintAndShade = 0
End With
End If
Next i
End Sub
不会有一位数吧?可以试试这个公式。
=ISNUMBER(MODE(--MID(TEXT(A1,"000;@"),{1,2,3},1)))
=IF(LEN(T(A1))>0,OR(IF(LEN(A1)=3,OR(NOT(ISERROR(FIND("1",A1,2))),MID(A1,2,1)=MID(A1,3,1)),0),IF(LEN(A1)=2,MID(A1,1,1)=MID(A1,2,1),0)),FALSE())
......