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

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
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
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
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
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,214,905
Messages
6,122,178
Members
449,071
Latest member
cdnMech

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
Back
Top