Find cells with a specific character in them and conditionally format cell

R

RITCHI

Hi

I want to format all rows in which the first cell in the row has a
comma in it somewhere.
Part of code only below:
A compile eror occurs at Find?

For Each cell In RefNoRange 'loops through
each cell in the reference number range

If IsError(Find(",", cell)) Then Else 'looks
for a comma in the ref number,
With cell.EntireRow
.RowHeight = 32
.VerticalAlignment = xlCenter
'.Font.ColorIndex = 1 'black
.Font.ColorIndex = 5 'blue
.Font.Size = 14
.Font.Name = "comic"
.Font.Bold = True
.Font.Italic = True


Any help would be gratefully received

Ritchi
 
D

Don Guillett

You have lots of errors. Try this
Sub formatif1()
For Each c In RefNoRange 'Selection
If InStr(c, ",") > 0 Then
MsgBox c.Address
With c.EntireRow
.RowHeight = 32
.VerticalAlignment = xlCenter
.Font.ColorIndex = 5 'blue
.Font.Size = 14
.Font.Name = "comic"
.Font.Bold = True
.Font.Italic = True
End With
End If
Next c
End Sub
 

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