ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I shade the active cell in excel (https://www.excelbanter.com/excel-worksheet-functions/98640-how-do-i-shade-active-cell-excel.html)

RogerK

How do I shade the active cell in excel
 
I have added hyperlinks to a spreadsheet, referring to data on another
worksheet in the same file. When clicking on the hyperlink, I would like the
resulting text under the active cursor to be highlighted

Bob Phillips

How do I shade the active cell in excel
 

'----------------------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'----------------------------------------------------------------
Cells.FormatConditions.Delete
With Target
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 36
End With

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

(replace somewhere in email address with gmail if mailing direct)

"RogerK" wrote in message
...
I have added hyperlinks to a spreadsheet, referring to data on another
worksheet in the same file. When clicking on the hyperlink, I would like

the
resulting text under the active cursor to be highlighted





All times are GMT +1. The time now is 02:14 AM.

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