How to change the active cell surrounding box color in Excel 2007

theojanissen

New Member
Joined
Dec 16, 2014
Messages
6
Hi all,

I have a workbook with cells in several background colours. Users have to fill in values in non-protected cells. However to find the cell in the that needs to be filled in it would be very helpfull if it was clearly visible prefferable instead of the thin black surrounding box in a thick orange surrounding box.

I found several related topics on the forum but just not a solution for this one, since all of them changing active cell colours permantly and I want them to go back to the standard coulor they had before coming active. For me the surounding box is OK.

Who has any idea how to do this?

Thankxxxx Theo from Holland :)
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
I'm trying to understand what you want. So I took a guess. If someone changes the data in a cell, either by putting data in a cell that was empty or changing the data that was in it this macro will change the border to a thin black border. If it was already a thin black border you will see obviously no change. If this is not what you want I need more details.

Right click on the tab for the sheet you want this to run on >> Choose view code and paste this code into the white area that shows up on the screen.

If you have a newer version of Excel I believe 2007 and newer you will have to save the file as a type .xlsm, for older version make sure you have macros enabled.


Code:
Private Sub Worksheet_Change(ByVal Target As Range)

With Target.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .ColorIndex = xlAutomatic
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Target.Borders(xlEdgeTop)
        .LineStyle = xlContinuous
        .ColorIndex = xlAutomatic
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Target.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .ColorIndex = xlAutomatic
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Target.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .ColorIndex = xlAutomatic
        .TintAndShade = 0
        .Weight = xlThin
    End With
        
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,250
Members
452,623
Latest member
Techenthusiast

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top