BorderAround settng wrong color

Warship

Well-known Member
Joined
Jul 17, 2007
Messages
1,055
Office Version
  1. 2016
  2. 2013
  3. 2007
Platform
  1. Windows
So I have a WB originally written in Excel2010.
On the same box with Excel 2007, BorderAround has lost it's mind in this WB.
At the moment I no longer have 2010 on this box to retry it there.

This code actually produces a border in blue RGB(0, 0, 238).
Code:
Selection.BorderAround Color:=RGB(255, 0, 0), Weight:=xlThick
Seems to be this behavior is only in the existing WB.
Newly added sheets to the same WB have the same behavior as well.

However newly added WB's do not.

Also regardless of how I code the color red - vbRed, -16776961, RGB(255, 0, 0) - all produce the blue RGB(0, 0, 238).
But only when using BorderAround.

Borders(xlEdgeTop) etc all work fine.

Any ideas?
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
of you don't force the blue, is there something else in CF that is flipping the colour on code ?
 
Upvote 0
thanks fro replying.
I did fail to mention there is no CF either.

Watching the area while stepping through the code it has zero formatting.
Until the BorderAround comes along.

Another Excel oddity I suppose.
Easy enough to recode without BorderAround.
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,196
Members
449,072
Latest member
DW Draft

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