How to change Excel selection style

Hi all,

I have to highlight a (multi)range in excel. I like it best, if I only have to select the range, but I don't like the normal selection mode. I am looking for an eyecatcher, like the border if you cut a cell. Is there a way to select a range and change the selection-border, without changing the content of the clipboard?

DatenkulturAsked:
Who is Participating?
 
ghoshsaikat83Connect With a Mentor Commented:
With my little knowledge in excel, I don't think it is possible.

Joydip
0
 
patrickabCommented:
>...I don't like the normal selection mode.

How are you selecting the range? Is it with a mouse or using F5?

Patrick
0
 
patrickabCommented:
Datenkultur,

The code below is in the attached file. It places a border around selected cells on Sheet1 only. To get rid of all the borders press CTRL+A. It's a horrible solution and I would personally never use it.

To get a proper solution you would need to rewrite the code for the cell cursor - and that is not possible as the code is not accessible.

I am not at all sure why you want to change something that everyone else finds acceptable?

Patrick
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlDashDotDot
        .Weight = xlMedium
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlDashDotDot
        .Weight = xlMedium
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlDashDotDot
        .Weight = xlMedium
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlDashDotDot
        .Weight = xlMedium
        .ColorIndex = xlAutomatic
    End With
    Selection.Borders(xlInsideVertical).LineStyle = xlNone
    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
End Sub

Open in new window

selection-border-01.xls
0
 
DatenkulturAuthor Commented:
Thanks for your code Patrickab, but I will not use the cellformats, because I have to store the old formats then. At the moment I try to use shapes, but they don't have events, so I have to use Charts for the events. I combine them, but there are some other problems now.

I think the question to change the select-mode has its answer in: Its not possible.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.