Sub ChangeColor() '======================================= '查找单元格字符串中数字部分,并标注颜色 '型号中一般缸径、行程均为数字表示,有助于观看。 '作者:xiaohe '======================================== Dim strNum() As String Dim i As Integer Dim strContent As String strContent = ActiveCell i = Len(strContent) ReDim strNum(i) For ii = 0 To i strNum(ii) = Right(Left(strContent, ii), 1) Next ii For j = LBound(strNum) To UBound(strNum) - 1 If Asc(strNum(j + 1)) >= 48 And Asc(strNum(j + 1)) <= 57 Then With ActiveCell.Characters(Start:=j + 1, Length:=1).Font .ColorIndex = 3 End With End If Next j End Sub
查找单元格字符串中数字部分,并标注红色 (原创)
最新推荐文章于 2023-11-29 13:58:07 发布