返回列表 上一主題 發帖

[發問] (已解決)VBA 特定符號及文字設定 程式請教

  1. Sub nn()
  2. Dim A As Range, y%
  3. For Each A In Range([A1], Cells(Rows.Count, 1).End(xlUp))
  4. A.Font.Bold = False
  5. A.Font.ColorIndex = 0
  6. i = 1
  7. Do Until Mid(A, i, 1) = "["
  8.   With A.Characters(i, 1).Font
  9.      .Bold = True
  10.      .ColorIndex = 5
  11.   End With
  12.   i = i + 1
  13. Loop
  14. s = InStr(A, "[")
  15. y = InStr(s, A, "]")
  16. Do Until s = 0
  17. A.Characters(s + 1, y - s - 1).Font.Bold = True
  18. s = InStr(y, A, "[")
  19. If s > 0 Then y = InStr(s, A, "]")
  20. Loop
  21. Next
  22. End Sub
複製代碼
回復 1# wind6424
學海無涯_不恥下問

TOP

回復 4# wind6424

不對吧!
Cells(6,8)只針對H6此一儲存格
學海無涯_不恥下問

TOP

        靜思自在 : 人要自愛,才能愛普天下的人。
返回列表 上一主題