Border Around ACTIVE Cell

Mister H

Well-known Member
Joined
Mar 6, 2002
Messages
1,507
Hi:

Does anyone know how to change the border (color or appearance) around the ACTIVE Cell. I have a spreadsheet that I created that has a lot of borders on it and whenever you tab to the cell your really need to look closely at the screen to see which cell is active. If I could change the borders around the active cell to a different clor that would be great. If you can't do this does anyone have a suggestion?

Thanks,
Mark
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
It would be easier to highlight selected cells with a different interior colour (and also make it easier to see what is selected):-

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Excel.Range)
Static PrevCell As Range
If Not PrevCell Is Nothing Then
PrevCell.Interior.ColorIndex = xlColorIndexNone
End If
Target.Interior.ColorIndex = 34
Set PrevCell = Target
End Sub

Note : this procedure will remove any interior cell colours that you might have on your worksheet when the cells are selected.
 
Upvote 0
Hi Mister H

You could try this, it works for me:
Use this event macro in your sheet

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("A1") = ActiveCell.Address
End Sub

Now select your area and use this formula in conditional formatting:
=ADDRESS(ROW(),COLUMN())=$A$1
Select a suitable color (say blue)

Now the active cell (or top left cell of active range) will temporarily highlight in blue.

Hope this works for you
regards
Derek
 
Upvote 0
Hey Derek, that brilliant! I love simple lateral thinking suggestions like that. If you email that to me (with any other details you have) I would like to put it in my next months newsletter along with your name, Website (if you have one) etc.
 
Upvote 0
On 2002-03-12 21:16, Derek wrote:
Hi Mister H

You could try this, it works for me:
Use this event macro in your sheet

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("A1") = ActiveCell.Address
End Sub

Now select your area and use this formula in conditional formatting:
=ADDRESS(ROW(),COLUMN())=$A$1
Select a suitable color (say blue)

Now the active cell (or top left cell of active range) will temporarily highlight in blue.

Hope this works for you
regards
Derek


I'm getting some erratic behaviour with this procedure.
I set the conditional format for all cells on a worksheet and sometimes the active cell turns blue but sometimes it will only turn blue when the cell is double-clicked. After double-clicking, the cell remains blue even after it is no longer the active cell.
What could be causing this?
 
Upvote 0
Yes, I noticed that too, that's why I suggested selecting a range first. I don't know why this is, perhaps 65536 cells is too much for it. Seems to works okay on a smaller area though. Perhaps someone knows the answer.

Thanks Dave, I am really flattered by your offer, but perhaps we had better hold off on my immortalisation in view of its apparent irratic behaviour. Seems logically it should work but perhaps some things are too good to be true!!!


Regards
Derek
This message was edited by Derek on 2002-03-13 01:33
 
Upvote 0
It's too cool an idea to let go so try this

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.FormatConditions.Delete
Target.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
Target.FormatConditions(1).Interior.ColorIndex = 27
End Sub
 
Upvote 0
Obviously this wouldn't be much use for much, but it's quite cool anyway. Try:

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Target.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
Target.FormatConditions(1).Interior.ColorIndex = Int((56 - 1 + 1) * Rnd + 1)
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,534
Messages
6,114,185
Members
448,554
Latest member
Gleisner2

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