AW: Gefüllte Zellen suchen, ganze Zeile fett setzen
02.06.2016 09:07:29
hary
Moin
Dann mal so?
Dim wks As Worksheet
Dim Bereich As Range, rngFind As Range, rFett As Range
Dim firstAddress As String
Set wks = Worksheets("Tabelle1") '--Blattname anpassen
Set Bereich = wks.Range("B18:B" & wks.Cells.SpecialCells(xlCellTypeLastCell).Row)
With Bereich
.EntireRow.Font.Bold = False
Set rngFind = Bereich.Find(what:="?*", LookIn:=xlValues, lookat:=xlWhole, searchdirection: _
=xlPrevious)
If Not rngFind Is Nothing Then
firstAddress = rngFind.Address
Do
If rFett Is Nothing Then
Set rFett = rngFind
Else
Set rFett = Union(rFett, rngFind)
End If
Set rngFind = Bereich.FindNext(rngFind)
Loop While rngFind.Address firstAddress
End If
End With
If Not rFett Is Nothing Then rFett.EntireRow.Font.Bold = True
Set wks = Nothing
Set Bereich = Nothing
Set rngFind = Nothing
Set rFett = Nothing
End Sub
Das kannst du aber auch mit bedingter Formatierung machen.
gruss hary