Library code snippets
Excel Coloured Cursor
By Gravitycure, published on 13 Mar 2002
The following code could be placed in either the Selection_Change procedure of a worksheet, or the SheetSelectionChange procedure of a workbook.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Interior.ColorIndex = xlColorIndexNone<br>
Selection.Interior.ColorIndex = 8
End Sub
This code works for sheets with no fills in the background, as everytime the selection changes it makes all the cell interior colours equal to no fill. Different background colours could be substituted in instead of xlColorIndexNone if necessary. The colour of the cursor can also be changed (8 is cyan). See VBA help for color indexes.
Related articles
Related discussion
-
Searching for several parameters with one dropdown selection
by egallen (1 replies)
-
VBA macro Help-plzzzzzzzzzzzzzzzzzzzzzz
by Uncle (2 replies)
-
Enable Formula Audting in an Excel Workbook where all the sheets are protected
by raviarul (0 replies)
-
Listing table in Access VIA code
by merkava (1 replies)
-
How to deal with the brackets?
by jitender.gupta007 (1 replies)
This is a cool code, but the draw back is, you are not able to copy and paste with this worksheet function in the normal way,
you would have to use the clip board
example
to copy a cell
Ctrl+c+c copies to the clipboard
Then you would have to use the clipboard to paste
or if you wanted to use code
Range("A1").Copy Destination:=Range("G1")
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Rows.Cells.Interior.ColorIndex = xlColorIndexNone
Selection.EntireRow.Cells.Interior.ColorIndex = 8
End Sub
I believe this will give you just columns A through I
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Interior.ColorIndex = xlColorIndexNone
Range("A" & Selection.Row, "I" & Selection.Row).Interior.ColorIndex = 19
End Sub
regards,
David
I like your colored Cursor but I need to highlight the whole row A thru I
as the cursor is moved downward or upward as Colum I contains Names
and I need to know if I am on the Right Name when I type an Entry.
I know I could probably put the names in the A Column But when Typeing in the H Colomn I would be back with the same problem.
Any Ideas?
Thanks
This thread is for discussions of Excel Coloured Cursor.