Ich will in einer Tabelle nur die Spalten, wo in Zeile 7 SUMME steht, und die Spalte in der in Zeile 6 Summe steht formatieren.
Sub SummeFormatieren()
Dim Suchwort1 As String
Dim rngCell1 As Range, Spalte1 As Range, Dim col_1 As Integer
Suchwort1 = "Summe"
For col_1 = 1 To 100
If ActiveSheet.Cells(7, col_1) = Suchwort1 Then
Cells(7, col_1).Font.Bold = True
Cells(7, col_1).SpecialCells(xlCellTypeConstants).Interior.ColorIndex = 15
Set rngCell1 = ActiveSheet.Rows(6).Find(Suchwort1, LookAt:=xlWhole, LookIn:=xlValues, MatchCase: _
=True)
If Not rngCell2 Is Nothing Then
Set Spalte1 = rngCell1.EntireColumn
Spalte1.Font.Bold = True
Intersect(Spalte1, ActiveSheet.UsedRange).Interior.ColorIndex = 16
End If
End If
Next col_1
Set Spalte1 = Nothing
Set rngCell1 = Nothing
End Sub
Er formatiert aber alle Zellen, in denen er etwas findet.Kann jemand helfen?
Viele Grüße