Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Curser Highlight
Does anyone know how to make the cell highlight, only when it it selected,
and keep moving with the curser as you move around the spreadsheet? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Curser Highlight
You may want to try Chip Pearson's Rowliner:
http://www.cpearson.com/excel/RowLiner.htm JayBham62 wrote: Does anyone know how to make the cell highlight, only when it it selected, and keep moving with the curser as you move around the spreadsheet? -- Dave Peterson |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Curser Highlight
Paste this into the files Thisworkbook Module - Selected cell will be
highlighted in all your sheets - even better this macro does not affect existing Conditional formatting.. Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range) Static OldCell As Range If Application.CutCopyMode = 0 Then If Not OldCell Is Nothing Then OldCell.Interior.ColorIndex = xlColorIndexNone OldCell.Borders.LineStyle = xlLineStyleNone End If Set OldCell = Target OldCell.Interior.ColorIndex = 6 OldCell.Borders.LineStyle = xlContinuous Else If OldCell Is Nothing Then Set OldCell = Target Else Set OldCell = Union(OldCell, Target) End If End If End Sub "JayBham62" wrote: Does anyone know how to make the cell highlight, only when it it selected, and keep moving with the curser as you move around the spreadsheet? |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Curser Highlight
"Jim May" wrote: Paste this into the files Thisworkbook Module - Selected cell will be highlighted in all your sheets - even better this macro does not affect existing Conditional formatting.. Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range) Static OldCell As Range If Application.CutCopyMode = 0 Then If Not OldCell Is Nothing Then OldCell.Interior.ColorIndex = xlColorIndexNone OldCell.Borders.LineStyle = xlLineStyleNone End If Set OldCell = Target OldCell.Interior.ColorIndex = 6 OldCell.Borders.LineStyle = xlContinuous Else If OldCell Is Nothing Then Set OldCell = Target Else Set OldCell = Union(OldCell, Target) End If End If End Sub "JayBham62" wrote: Does anyone know how to make the cell highlight, only when it it selected, and keep moving with the curser as you move around the spreadsheet? |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Curser Highlight
Thanks Jim That is cool!
"Jim May" wrote: Paste this into the files Thisworkbook Module - Selected cell will be highlighted in all your sheets - even better this macro does not affect existing Conditional formatting.. Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range) Static OldCell As Range If Application.CutCopyMode = 0 Then If Not OldCell Is Nothing Then OldCell.Interior.ColorIndex = xlColorIndexNone OldCell.Borders.LineStyle = xlLineStyleNone End If Set OldCell = Target OldCell.Interior.ColorIndex = 6 OldCell.Borders.LineStyle = xlContinuous Else If OldCell Is Nothing Then Set OldCell = Target Else Set OldCell = Union(OldCell, Target) End If End If End Sub "JayBham62" wrote: Does anyone know how to make the cell highlight, only when it it selected, and keep moving with the curser as you move around the spreadsheet? |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
Curser Highlight
Thanks for the feedback; glad it worked for you...
"JayBham62" wrote: Thanks Jim That is cool! "Jim May" wrote: Paste this into the files Thisworkbook Module - Selected cell will be highlighted in all your sheets - even better this macro does not affect existing Conditional formatting.. Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range) Static OldCell As Range If Application.CutCopyMode = 0 Then If Not OldCell Is Nothing Then OldCell.Interior.ColorIndex = xlColorIndexNone OldCell.Borders.LineStyle = xlLineStyleNone End If Set OldCell = Target OldCell.Interior.ColorIndex = 6 OldCell.Borders.LineStyle = xlContinuous Else If OldCell Is Nothing Then Set OldCell = Target Else Set OldCell = Union(OldCell, Target) End If End If End Sub "JayBham62" wrote: Does anyone know how to make the cell highlight, only when it it selected, and keep moving with the curser as you move around the spreadsheet? |
#7
Posted to microsoft.public.excel.misc
|
|||
|
|||
Curser Highlight
Nice sub there, Jim.
Is there a way for a user choice to toggle the feature on/off, when the wb is opened? Eg: when I'm working on the wb, I may want it to be toggled off so that undo is not disabled (as per normal). But when I'm presenting/discussing the wb with others, I wld like to have the cell highlight feature "on". Thanks -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- |
#8
Posted to microsoft.public.excel.misc
|
|||
|
|||
Curser Highlight
Thanks Max;
My initial response goes to perhaps setting up a Flag (boolean) type for On/Off, True/False... you know... "Max" wrote: Nice sub there, Jim. Is there a way for a user choice to toggle the feature on/off, when the wb is opened? Eg: when I'm working on the wb, I may want it to be toggled off so that undo is not disabled (as per normal). But when I'm presenting/discussing the wb with others, I wld like to have the cell highlight feature "on". Thanks -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- |
#9
Posted to microsoft.public.excel.misc
|
|||
|
|||
Curser Highlight
"Jim May" wrote
Thanks Max; My initial response goes to perhaps setting up a Flag (boolean) type for On/Off, True/False... you know I won't know how to do that <g. Any sample code how it could be worked into here? -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- .... |
#10
Posted to microsoft.public.excel.misc
|
|||
|
|||
Curser Highlight
Here's my entire code:
1) Paste these top two (2) macros into your ThisWorkbook Module. 2) Paste the next Block (one Declaration ststement & one Macro into a Standard module) 3) Use the Forms Command Button and assign the TogglebFlag macro to it. Hope that helps.. Jim Private Sub Workbook_Open() bFlag = True ActiveCell.Interior.ColorIndex = xlColorIndexNone ActiveCell.Borders.LineStyle = xlLineStyleNone End Sub Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range) Static OldCell As Range If bFlag = True Then If Application.CutCopyMode = 0 Then If Not OldCell Is Nothing Then OldCell.Interior.ColorIndex = xlColorIndexNone OldCell.Borders.LineStyle = xlLineStyleNone End If Set OldCell = Target OldCell.Interior.ColorIndex = 6 OldCell.Borders.LineStyle = xlContinuous Else If OldCell Is Nothing Then Set OldCell = Target Else Set OldCell = Union(OldCell, Target) End If End If End If End Sub 2: Public bFlag As Boolean ' This should appear in the Declarations Section Sub TogglebFlag() Set OldCell = Nothing ActiveCell.Interior.ColorIndex = xlColorIndexNone ActiveCell.Borders.LineStyle = xlLineStyleNone If bFlag = True Then bFlag = False Else: bFlag = True End If End Sub "Max" wrote: "Jim May" wrote Thanks Max; My initial response goes to perhaps setting up a Flag (boolean) type for On/Off, True/False... you know I won't know how to do that <g. Any sample code how it could be worked into here? -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- .... |
#11
Posted to microsoft.public.excel.misc
|
|||
|
|||
Curser Highlight
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
highlight curser so I can see it | Excel Discussion (Misc queries) | |||
spreadsheet Curser | Excel Discussion (Misc queries) | |||
Wild curser | Excel Discussion (Misc queries) | |||
Wild curser | Excel Discussion (Misc queries) | |||
Highlight cells with ctrl-click but only un-highlight one cell | Excel Discussion (Misc queries) |