- 帖子
- 526
- 主題
- 56
- 精華
- 0
- 積分
- 604
- 點名
- 102
- 作業系統
- win 10
- 軟體版本
- []
- 閱讀權限
- 50
- 性別
- 男
- 註冊時間
- 2013-3-19
- 最後登錄
- 2025-5-2
           
|
5#
發表於 2019-5-18 10:53
| 只看該作者
回復 4# Airman
請參考,檢查看看這是不是你要的:
For Each Rng In .Range("AZ1:CC1")
Rng.Value = Replace(Rng, "大", "小")
If Rng.Interior.ColorIndex = 43 Then
Rng.Interior.ColorIndex = 40
ElseIf Rng.Interior.ColorIndex = 8 Then
Rng.Interior.ColorIndex = 39
ElseIf Rng.Interior.ColorIndex = 37 Then
Rng.Interior.ColorIndex = 45
End If
Next
上面的就取代下面的囉;
'''' Range("AZ1:CC1").Replace "大", "小"
''''
'''' Range("AZ1:CC1").Select
'''' Application.FindFormat.Interior.ColorIndex = 43
'''' Application.ReplaceFormat.Interior.ColorIndex = 40
'''' Selection.Replace What:="", Replacement:="", LookAt:=xlPart, SearchOrder _
'''' :=xlByColumns, MatchCase:=False, SearchFormat:=True, ReplaceFormat:=True
''''
'''' Application.FindFormat.Interior.ColorIndex = 8
'''' Application.ReplaceFormat.Interior.ColorIndex = 39
'''' Selection.Replace What:="", Replacement:="", LookAt:=xlPart, SearchOrder _
'''' :=xlByColumns, MatchCase:=False, SearchFormat:=True, ReplaceFormat:=True
''''
'''' Application.FindFormat.Interior.ColorIndex = 37
'''' Application.ReplaceFormat.Interior.ColorIndex = 45
'''' Selection.Replace What:="", Replacement:="", LookAt:=xlPart, SearchOrder _
'''' :=xlByColumns, MatchCase:=False, SearchFormat:=True, ReplaceFormat:=True |
|