View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
sdg8481 sdg8481 is offline
external usenet poster
 
Posts: 29
Default select multiple rows and format

THANKS GUYS...Works perfect

"Mike H" wrote:

Don,

I think the OP may be a bit cross if he deletes the rows he was trying to
format as bold:)

perhaps you meant this

delRng.EntireRow.Font.Bold = True

Mike

"Don Guillett" wrote:

Sub FindAndDeleteRow()

Dim FoundCell As Range
Dim FirstAddress As String
Dim delRng As Range

With Worksheets("sheet2").Range("a1:a25")
Set FoundCell = .Cells.Find(what:="college", _
after:=.Cells(.Cells.Count), _
LookIn:=xlValues, lookat:=xlPart, MatchCase:=False)

If FoundCell Is Nothing Then
Else
FirstAddress = FoundCell.Address
Do
If delRng Is Nothing Then
Set delRng = FoundCell
Else
Set delRng = Union(delRng, FoundCell)
End If
Set FoundCell = .FindNext(FoundCell)
Loop While Not FoundCell Is Nothing _
And FoundCell.Address < FirstAddress
End If
End With

If delRng Is Nothing Then

Else
delRng.EntireRow.Delete
End If
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"sdg8481" wrote in message
...
Hi,

I have a fairly simple request, but i just just can't seems to find a
solution, hope one of you can help...

Basically, i need a VBA code that will bold the text of the entire row if
the word "College" exists somewhere in column E. It maybe worth pointing
out
that this word may be part of a phrase so not sure if wildcard characters
will be needed.

If tried the usual and ideas found on this site, however i can't use the
simple filter options because my spreadsheet contains multiple empty rows,
therefore i think VBA id the way to go.

Hope this makes sense and that you can help.