bolding a row when cell is selected

deedee88

Board Regular
Joined
Jan 17, 2009
Messages
98
Hi

I would like excel to bold the entire row when a cell is selected, but it should go back no its normal formatting when the cell is not longer selected.

I saw something like this in the forum, but now I can't seem to find it.

Thank you,
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
This may be what you're after:

<font face=Calibri><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> Worksheet_SelectionChange(<SPAN style="color:#00007F">ByVal</SPAN> Target <SPAN style="color:#00007F">As</SPAN> Excel.Range)<br>    Cells.Font.Bold = <SPAN style="color:#00007F">False</SPAN><br>    ActiveCell.EntireRow.Font.Bold = <SPAN style="color:#00007F">True</SPAN><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>

HTH,
 
Upvote 0

nbrcrunch

Well-known Member
Joined
Jan 1, 2003
Messages
2,062
this one does cross hairs. I don't remember the author

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
' Wipe out existing formatting
' Note: this wipes out all existing interior cell colors!
Cells.Interior.ColorIndex = xlNone
' Color the Active Row
With ActiveCell.EntireRow.Interior
.ColorIndex = 36
.Pattern = xlSolid
End With
' Color the Active Column
With ActiveCell.EntireColumn.Interior
.ColorIndex = 36
.Pattern = xlSolid
End With
End Sub
 
Upvote 0

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,484
This might be terribly wrong (causing some other problem), but this seemed to work for me... Paste the code into the objecy module of the Sheet you are working with...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static lastrow As Long

On Error Resume Next
Range(lastrow & ":" & lastrow).EntireRow.Font.Bold = False
Target.EntireRow.Font.Bold = True
lastrow = Target.Row
End Sub
 
Upvote 0

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,484
What if you ALREADY have Required Bolding in affect in an area of your sheet
and you select it. Wont this destroy the original bolding effect? Hummmmm...
 
Upvote 0

Forum statistics

Threads
1,196,019
Messages
6,012,898
Members
441,738
Latest member
dataexcel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top