ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Automatic Bolding and Background Coloring (https://www.excelbanter.com/excel-programming/303700-re-automatic-bolding-background-coloring.html)

Bob Phillips[_6_]

Automatic Bolding and Background Coloring
 
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Target.Column = 3 Then
With Target.EntireRow
.Font.Bold = True
.Interior.ColorIndex = 6
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub


'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"OriginalStealth" wrote in
message ...
ID TITLE TitleID

66749 Devil's Advocate 323484
66750 Warner Cable 3 301350
66750 Warner Cable 3 301350
66750 Warner Cable 3 301350
66750 Warner Cable 3 301350
66795 Paycheck 322940

1. How can I double-click on the ID and have the whole
line bold and the row changes to yellow.

2. When I click an ID that has duplicates beneath it, the
first line bolds and all of them turn yellow.

Thanks in advance
OS





Frank Kabel

Automatic Bolding and Background Coloring
 
Hi Bob
but this will not reset the color after the selection :-)
(and as a sidenote will not color duplicate rows...)

P.S.: Have you received my second email regarding your website?
--
Regards
Frank Kabel
Frankfurt, Germany


Bob Phillips wrote:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Target.Column = 3 Then
With Target.EntireRow
.Font.Bold = True
.Interior.ColorIndex = 6
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub


'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


"OriginalStealth" wrote

in
message ...
ID TITLE TitleID

66749 Devil's Advocate 323484
66750 Warner Cable 3 301350
66750 Warner Cable 3 301350
66750 Warner Cable 3 301350
66750 Warner Cable 3 301350
66795 Paycheck 322940

1. How can I double-click on the ID and have the whole
line bold and the row changes to yellow.

2. When I click an ID that has duplicates beneath it, the
first line bolds and all of them turn yellow.

Thanks in advance
OS




All times are GMT +1. The time now is 07:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com