ich habe eine Exceltabelle mit Spalten A bis F und ca. 200 Zeilen. Nun möchte ich, dass alle Zeilen, bei denen in Spalte B das Wert "Total" erscheint fett formatiert werden. Was muß ich tun? Schon mal vielen Dank für Eure Hilfe.
Gruß Nicole
Sub niki()
wert = "Total"
With Worksheets(1).Range("b1:b500")
Set c = .Find(wert, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
Cells(c.Row, c.Column).Select
Selection.Font.Bold = True
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
End Sub
Option Explicit
Sub total_()
Const s As String = "Total"
Dim c As Range, addr As String
With Worksheets(1).Columns(2)
Set c = .Find(s, lookat:=xlWhole)
If Not c Is Nothing Then
addr = c.Address
Do
c.EntireRow.Font.Bold = True
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> addr
End If
End With
End Sub
Die erweiterte Suchfunktion hilft dir, gezielt die besten Antworten zu finden
Suche nach den besten AntwortenEntdecke unsere meistgeklickten Beiträge in der Google Suche
Top 100 Threads jetzt ansehen