How do I bold entire row with an asterisk in the text?

T

timwell

Hi,
I have a spreadsheet with 16 columns. Column C has text in each
cell. In some of the cells in column C there is an (asterisk) * with
the text. For example CARS *. I would like in each instance of the
asterisk in column C to bold that entire row. Then move on to the
next row until there are no more asterisks. I will not have more
than 500 rows. Thanks for any help with this. TimW
 
R

Rick Rothstein \(MVP - VB\)

Give this macro a try...

Sub MakeRowBold()
Dim C As Range
Dim LastRow As Long
With Worksheets("Sheet1")
LastRow = .Cells(.Rows.Count, "C").Row
For Each C In Range("C1:C" & LastRow)
If InStr(C.Value, "*") Then
C.EntireRow.Font.Bold = True
End If
Next
End With
End Sub

Change the worksheet name in the With statement to the name of your actual
sheet.

Rick
 
J

James Snell

Hi Tim,

It sounds like you're looking for a conditional format based on a formula.
To implement it...

Select cell A1
Click Format > Conditional Formatting
Set the options for the condition to:-
Formula Is
=IF(FIND("*",$C1)>0,TRUE,FALSE)
Set a format then OK out of the dialogues
Select the format painter from the toolbar then click in the box above the
number 1 row label.

The whole sheet is now set to apply that format if a * appears in column C
of the row.


Hope that helps.

~ James
 
R

Rick Rothstein \(MVP - VB\)

Show a programmer (me) what looks like a programming question in a
programming newsgroup and he (me) will come up with a programming solution
every time.<g>

Of course, your Conditional Formatting suggestion is far superior to what I
posted... 'timwell' take note.

Rick
 
T

timwell

Show a programmer (me) what looks like a programming question in a
programming newsgroup and he (me) will come up with a programming solution
every time.<g>

Of course, your Conditional Formatting suggestion is far superior to what I
posted... 'timwell' take note.

Rick












- Show quoted text -

Thanks so much guys. I used the conditional formatting suggested by
James. Rick your comments were very appreciated. I had earlier tried
both methods but couldn't get either to work for me. I do not post
often so I hope I replied correctly. Again thank you! TimW
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top