ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Highlight Cell (https://www.excelbanter.com/excel-programming/336002-highlight-cell.html)

choice[_2_]

Highlight Cell
 
is there a way to have a cell highlighted when it is selected? any cell.
also is it possible to get rid of the thicker border around the cell selected?

Thanks in advance

Norman Jones

Highlight Cell
 
Hi Choice,

See Chip Pearson's 'Highlight Active Cell ' page at:

http://www.cpearson.com/excel/excelM...ightActiveCell


---
Regards,
Norman



"choice" wrote in message
...
is there a way to have a cell highlighted when it is selected? any cell.
also is it possible to get rid of the thicker border around the cell
selected?

Thanks in advance




Greg Wilson

Highlight Cell
 
The problem with highlight code is that it leaves the cell highlighted on
workbook close and forgets its on subsequent open. Hence, the cell stays
highlighted. This in theory should fix the problems. Granted, I never use it
so maybe it's not that reliable. I hate cell highlighting, sound effects, and
sin of all sins: Flashing Cells !!! Since you've proven you have no taste
whatsoever by asking for cell highlighting then maybe you'll like my code <g.

As far as getting rid of the selection border, I don't think anyone has
found a solution short of colouring all cells dark gray (color index 16 I
think) or other kludge. IMO, this is not supported by VBA and is integral to
Excel, hence API code won't help.

In the ThisWorkbook module paste the following:
Private Sub Workbook_Deactivate()
If Not PrevCell Is Nothing Then _
PrevCell.Interior.ColorIndex = PrevColor
End Sub

In the worksheet code module paste the following:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
If Target.Count 1 Then Exit Sub
If PrevCell Is Nothing Then
Set PrevCell = Target
PrevColor = PrevCell.Interior.ColorIndex
Else
PrevCell.Interior.ColorIndex = PrevColor
Set PrevCell = Target
PrevColor = Target.Interior.ColorIndex
End If
Target.Interior.ColorIndex = 6
End Sub

In a standard module paste the following:
Public PrevCell As Range
Public PrevColor As Integer

Regards,
Greg


"choice" wrote:

is there a way to have a cell highlighted when it is selected? any cell.
also is it possible to get rid of the thicker border around the cell selected?

Thanks in advance


Norman Jones

Highlight Cell
 
Hi Greg,

As far as getting rid of the selection border, I don't think anyone has
found a solution


Surely, however, if the sound effects were sufficiently, enterprisingly
selected and the strobic flashing optimally calculated, the selection
borders would be rendered undetectable?

---
Regards,
Norman



"Greg Wilson" wrote in message
...
The problem with highlight code is that it leaves the cell highlighted on
workbook close and forgets its on subsequent open. Hence, the cell stays
highlighted. This in theory should fix the problems. Granted, I never use
it
so maybe it's not that reliable. I hate cell highlighting, sound effects,
and
sin of all sins: Flashing Cells !!! Since you've proven you have no taste
whatsoever by asking for cell highlighting then maybe you'll like my code
<g.

As far as getting rid of the selection border, I don't think anyone has
found a solution short of colouring all cells dark gray (color index 16 I
think) or other kludge. IMO, this is not supported by VBA and is integral
to
Excel, hence API code won't help.

In the ThisWorkbook module paste the following:
Private Sub Workbook_Deactivate()
If Not PrevCell Is Nothing Then _
PrevCell.Interior.ColorIndex = PrevColor
End Sub

In the worksheet code module paste the following:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
If Target.Count 1 Then Exit Sub
If PrevCell Is Nothing Then
Set PrevCell = Target
PrevColor = PrevCell.Interior.ColorIndex
Else
PrevCell.Interior.ColorIndex = PrevColor
Set PrevCell = Target
PrevColor = Target.Interior.ColorIndex
End If
Target.Interior.ColorIndex = 6
End Sub

In a standard module paste the following:
Public PrevCell As Range
Public PrevColor As Integer

Regards,
Greg


"choice" wrote:

is there a way to have a cell highlighted when it is selected? any cell.
also is it possible to get rid of the thicker border around the cell
selected?

Thanks in advance




Greg Wilson

Highlight Cell
 
Like your idea about using Ctrl_V better Norman <g.

Regards,
Greg

"Norman Jones" wrote:

Hi Greg,

As far as getting rid of the selection border, I don't think anyone has
found a solution


Surely, however, if the sound effects were sufficiently, enterprisingly
selected and the strobic flashing optimally calculated, the selection
borders would be rendered undetectable?

---
Regards,
Norman



"Greg Wilson" wrote in message
...
The problem with highlight code is that it leaves the cell highlighted on
workbook close and forgets its on subsequent open. Hence, the cell stays
highlighted. This in theory should fix the problems. Granted, I never use
it
so maybe it's not that reliable. I hate cell highlighting, sound effects,
and
sin of all sins: Flashing Cells !!! Since you've proven you have no taste
whatsoever by asking for cell highlighting then maybe you'll like my code
<g.

As far as getting rid of the selection border, I don't think anyone has
found a solution short of colouring all cells dark gray (color index 16 I
think) or other kludge. IMO, this is not supported by VBA and is integral
to
Excel, hence API code won't help.

In the ThisWorkbook module paste the following:
Private Sub Workbook_Deactivate()
If Not PrevCell Is Nothing Then _
PrevCell.Interior.ColorIndex = PrevColor
End Sub

In the worksheet code module paste the following:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
If Target.Count 1 Then Exit Sub
If PrevCell Is Nothing Then
Set PrevCell = Target
PrevColor = PrevCell.Interior.ColorIndex
Else
PrevCell.Interior.ColorIndex = PrevColor
Set PrevCell = Target
PrevColor = Target.Interior.ColorIndex
End If
Target.Interior.ColorIndex = 6
End Sub

In a standard module paste the following:
Public PrevCell As Range
Public PrevColor As Integer

Regards,
Greg


"choice" wrote:

is there a way to have a cell highlighted when it is selected? any cell.
also is it possible to get rid of the thicker border around the cell
selected?

Thanks in advance






All times are GMT +1. The time now is 05:46 PM.

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