highlight

M

Michael Smith

I would like to write a formula that highlights the entire row of
information when one cell is populated. Is there a way to do that? I know
under conditional formatting you can change one cell when information is
populated. However, this is limited to one cell. Unless, I have missed
something. Please help.
 
D

Don Guillett

right click sheet tab>view code>copy/paste this>save

'McCurdy.Here is something inspired by Don Guillett.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim MyRng As Range
Set MyRng = Target.EntireRow
Application.EnableEvents = False
On Error GoTo end1
Application.Cells.FormatConditions.Delete
With MyRng
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=ROW()=ROW(INDIRECT(CELL(""address"")))"
With .FormatConditions(1).Font
.Bold = True
.Italic = False
.ColorIndex = 1
End With
.FormatConditions(1).Interior.ColorIndex = 36
End With
end1:
Application.EnableEvents = True
End Sub
 
D

Dave Peterson

You can use format|conditional formatting.

Select the range (all the columns and rows you want affected).

I selected A2:X99
And I want the row formatted when I put something in column G of that row.
With the activecell in Row 2
Format|conditional formatting
Formula is:
=$g2<>""
give it a nice format

The $g means that it's always checking column G no matter what cell is active.

By not using $2, the formula will adjust for other rows.
 
Top