返回列表 上一主題 發帖

字串中某幾個字元變色

A1輸入AAA,B1輸入111AAA333
  1. Private Sub CommandButton1_Click()
  2.   On Error Resume Next
  3.     xx = Len([a1])
  4.     yy = Application.Search([a1], [b1])
  5.     Range("B1").Select
  6.     With ActiveCell.Characters(Start:=yy, Length:=xx).Font
  7.         .ColorIndex = 3
  8.     End With
  9. End Sub
複製代碼
YOYO

TOP

        靜思自在 : 為人處世要小心細心,但不要「小心眼」。
返回列表 上一主題