Is it possible to highlight the current cursor cell you are on in colour, to help identify where you are on the
spreadsheet, i.e.identify location?
For example if you are on cell A1 can it be highlighted in yellow, so when you move on to other cells eg. A10 it then
only highlights that cell in yellow.
Thank you
Susan
There is probably a better way...but it can be done with the Change
Event. This code appears to work.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'
Range(Cells(1, 1), Cells(65536, 256)).Interior.ColorIndex = xlNone
Target.Interior.ColorIndex = 6
'
End Sub
It needs to go with the sheet for which you want this to happen.
HTH
John
http://www.cpearson.com/excel/rowliner.htm
--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03
----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------
"Susan Hayes" <as...@hotmail.com> wrote in message
news:1abjh1hfq64g4317i...@4ax.com...
'----------------------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'----------------------------------------------------------------
Cells.FormatConditions.Delete
With Target
With .EntireRow
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
With .FormatConditions(1)
With .Borders(xlTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With
With .Borders(xlBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With
.Interior.ColorIndex = 20
End With
End With
With .EntireColumn
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
With .FormatConditions(1)
With .Borders(xlLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With
With .Borders(xlRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With
.Interior.ColorIndex = 20
End With
End With
.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.
--
Bob Phillips
------------------------------------------------------------------------
Bob Phillips's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=26952
View this thread: http://www.excelforum.com/showthread.php?threadid=401700
Just want to say thanks for your code example. IMO, this is the best I've
seen on the subject.
Greg Wilson
Very pretty, after adding in a bunch of periods that I think you may have
been missing <g>:
End Sub
Regards,
Vasant
"Bob Phillips" <Bob.Phillips.1usl...@excelforum-nospam.com>
wrote in message
news:Bob.Phillips.1usl...@excelforum-nospam.com...
>
> Here is another alternative
>
>
> '----------------------------------------------------------------
> Private Sub Worksheet_SelectionChange(ByVal Target As Range)
> '----------------------------------------------------------------
> Cells.FormatConditions.Delete
> With Target
> With .EntireRow
> FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
> With .FormatConditions(1)
> With .Borders(xlTop)
> LineStyle = xlContinuous
> Weight = xlThin
> ColorIndex = 5
> End With
> With .Borders(xlBottom)
> LineStyle = xlContinuous
> Weight = xlThin
> ColorIndex = 5
> End With
> Interior.ColorIndex = 20
> End With
> End With
> With .EntireColumn
> FormatConditions.Delete
> FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
> With .FormatConditions(1)
> With .Borders(xlLeft)
> LineStyle = xlContinuous
> Weight = xlThin
> ColorIndex = 5
> End With
> With .Borders(xlRight)
> LineStyle = xlContinuous
> Weight = xlThin
> ColorIndex = 5
> End With
> Interior.ColorIndex = 20
> End With
> End With
>
> FormatConditions.Delete
> FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
http://www.mrexcel.com/board2/viewtopic.php?t=14546
Also note from that link the international version as "True" is
different in different languages. Sub links provide alternate Non
conditional formating options.
--
Ivan F Moala
------------------------------------------------------------------------
Ivan F Moala's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1954
End Sub
Regards
Ken........................
<snip>
Regards
Ken......................
"Greg Wilson" <GregW...@discussions.microsoft.com> wrote in message
news:EC0ED80B-B712-4247...@microsoft.com...
> Bob,
>
> Just want to say thanks for your code example. IMO, this is the best I've
> seen on the subject.
>
> Greg Wilson
>
<snip>
=OR(CELL("col")=COLUMN(),CELL("row")=ROW())
For the sheets event we need to force a calculation each time a cell is selected.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Calculate
End Sub
That's it! - enjoy.
Regards
Robert McCurdy
"Ken Wright" <ken.w...@NOSPAMntlworld.com> wrote in message news:usf0KATs...@tk2msftngp13.phx.gbl...