を強調Iは 複数の列中に存在してもよい テキスト文字列の複数枚(カラムJ範囲カラムAで言う)探索全体Excelワークブックとセル
を含む全体のExcelworkbook
を検索する必要があります
テキスト文字列が見つかると、セルにカラーフォーマットが適用されます。
これが可能ですか、それとも1枚ごとにルールを作成する必要がありますか?
例:
- 検索文字列「情報」どこでも私の
workbook
と形式のセルで青
私が入るように複数の異なるテキスト文字列を持っており、それぞれが異なる色のフォーマットを持つことになります。
これらをすべて1つのルールで組み合わせる方法はありますか?それとも、それぞれのテキスト・ストリングごとに同じルールを使用して、それぞれに新しいルールを作成させるだけですか?
私はExcelの条件付き書式では本当に新しいので、あなたが優しく、それぞれのステップを踏んでくれれば幸いです。
私はoracleインターネットを検索し、この解決策を見つけました。私はそれをテストする必要があるが、それは私が必要とするものを行うかもしれない。
これは、ChooseColorsというテーブルを作成する必要があります。最初の列は検索文字列、2番目の列は使用可能な範囲の色です。 検索領域が2番目のシートにあります - このシートから開始します。
コード:
Sub DoColors()
Dim Picker As Variant
Dim Colors As Variant
Dim Rws As Long, j As Long
Dim i As Integer
Dim Sht As String
Dim c As Range
Dim FirstAddress
Sht = ActiveSheet.Name
'load search strings and colors into arrays
Application.Goto Reference:="ChooseColors"
ReDim Picker(1 To Selection.Rows.Count)
ReDim Colors(1 To Selection.Rows.Count)
For i = 1 To Selection.Rows.Count
Picker(i) = ActiveCell.Value
Colors(i) = ActiveCell.Offset(0, 1).Interior.ColorIndex
ActiveCell.Offset(1, 0).Select
Next i
'search the test range, changing backgrounds as required
Sheets(Sht).Activate
For i = 1 To UBound(Picker)
With Cells.SpecialCells(xlCellTypeConstants, xlTextValues)
Set c = .Find(Picker(i), LookIn:=xlValues)
If Not c Is Nothing Then
FirstAddress = c.Address
Do
c.Interior.ColorIndex = Colors(i)
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> FirstAddress
End If
End With
Next i
End Sub
新しい色の新しい条件は新しいルールである必要があります –
[excel-vba]で質問にタグを付けると、 VBAソリューション? – Luuklag
これは間違いなくマクロが必要です。 VBAはここに救助する! :D – Jaberwocky