Active Cell

G

grahammal

Is there any way to change the look of the active cell. ie have a re
border round it or the fill be in colour
 
B

Bob Phillips

'----------------------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'----------------------------------------------------------------
Cells.FormatConditions.Delete
With ActiveCell
.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

(remove nothere from email address if mailing direct)
 
T

tcebob

Bob, It works just fine and fills a need which I think MS should address. 2 questions: Do
you know of a way to eliminate the black outline on the active cell? and Is there a method
of making the routine load via an automatic macro every time a sheet is opened? (It's so
small that the load macro need not decide whether it's there already.)

tcebob


:
: Is there any way to change the look of the active cell. ie have a red
: border round it or the fill be in colour?
:
:
: --
: grahammal
: ------------------------------------------------------------------------
: grahammal's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=20336
: View this thread: http://www.excelforum.com/showthread.php?threadid=518185
:
 
B

Bob Phillips

This does it for every worksheet

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

End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

Bob Phillips said:
'----------------------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'----------------------------------------------------------------
Cells.FormatConditions.Delete
With ActiveCell
.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

(remove nothere from email address if mailing direct)
 
B

Bob Phillips

Correction

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

End Sub

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
Top