excel中如何标记文本中的数字

2024-11-26 11:53:11
推荐回答(1个)
回答1:

据我所知,简单设置可能不行哈。当然个人所知有限。
但是可以通过简单的程序来实现。
当然,我要问的是您所说的,每个单元格中。。。。是指数字和蚊子都在同意个单元格中还是说单元格中分别是数字还是文字。
希望你补充,稍后给你代码
先按ALT + F11,双击SHEET1,复制下列代码,粘贴,按F5
Sub ttte()
Dim i As Integer
Dim bb As String
i = i + 1
For i = 1 To 100
bb = ThisWorkbook.Sheets("Sheet1").Cells(i, 2).Value
If Left(bb, 1) = "0" Then
ThisWorkbook.Sheets("Sheet1").Cells(i, 2).Select
With Selection.Interior
.ColorIndex = 5
End With
End If
If Left(bb, 1) = "1" Then
ThisWorkbook.Sheets("Sheet1").Cells(i, 2).Select
With Selection.Interior
.ColorIndex = 5
End With
End If
If Left(bb, 1) = "2" Then
ThisWorkbook.Sheets("Sheet1").Cells(i, 2).Select
With Selection.Interior
.ColorIndex = 5
End With
End If
If Left(bb, 1) = "3" Then
ThisWorkbook.Sheets("Sheet1").Cells(i, 2).Select
With Selection.Interior
.ColorIndex = 5
End With
End If
If Left(bb, 1) = "4" Then
ThisWorkbook.Sheets("Sheet1").Cells(i, 2).Select
With Selection.Interior
.ColorIndex = 5
End With
End If
If Left(bb, 1) = "5" Then
ThisWorkbook.Sheets("Sheet1").Cells(i, 2).Select
With Selection.Interior
.ColorIndex = 5
End With
End If
If Left(bb, 1) = "6" Then
ThisWorkbook.Sheets("Sheet1").Cells(i, 2).Select
With Selection.Interior
.ColorIndex = 5
End With
End If
If Left(bb, 1) = "7" Then
ThisWorkbook.Sheets("Sheet1").Cells(i, 2).Select
With Selection.Interior
.ColorIndex = 5
End With
End If
If Left(bb, 1) = "8" Then
ThisWorkbook.Sheets("Sheet1").Cells(i, 2).Select
With Selection.Interior
.ColorIndex = 5
End With
End If
If Left(bb, 1) = "9" Then
ThisWorkbook.Sheets("Sheet1").Cells(i, 2).Select
With Selection.Interior
.ColorIndex = 5
End With
End If
Next i

End Sub
哦,那样的也是可以的,不过要过几天才给你代码啊,失恋了,心情不好。抱歉哈