返回列表 上一主題 發帖

[發問] 字串中若含有?,怎麼格式化條件?

[發問] 字串中若含有?,怎麼格式化條件?

請問若如下狀態,使用符合條件關鍵字"?",將會把四個儲存格都格式化條件..成為一種顏色
? 是代表所有字元,不能單獨符合才變色嗎?

       A
1    123?321
2    123
3    ?321
4     123?
  1. Sub Macro2()

  2.     Columns("A:A").Select
  3.     Selection.FormatConditions.Add Type:=xlTextString, String:="?", _
  4.         TextOperator:=xlContains
  5.     Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
  6.     With Selection.FormatConditions(1).Font
  7.         .Color = -16383844
  8.         .TintAndShade = 0
  9.     End With
  10.     With Selection.FormatConditions(1).Interior
  11.         .PatternColorIndex = xlAutomatic
  12.         .Color = 13551615
  13.         .TintAndShade = 0
  14.     End With
  15.     Selection.FormatConditions(1).StopIfTrue = False
  16.     Range("D5").Select
  17. End Sub
複製代碼

可考慮用公式:
=FIND("?",A1)

TOP

可考慮用公式:
=FIND("?",A1)
准提部林 發表於 2016-6-13 18:17


謝謝版主~可以符合了~

TOP

        靜思自在 : 【生命在呼吸間】佛陀說:「生命在呼吸間。」人無法管住自己的生命,更無法擋住死期,讓自己永住人間。既然生命去來這麼無常,我們更應該好好地愛惜它、利用它、充實它,讓這無常、寶貴的生命,散發它真善美的光輝,映照出生命真正的價值。
返回列表 上一主題