How to detect if a cell has border and where?

JohnPoole

Active Member
Joined
Jun 9, 2005
Messages
267
Hi all, I'm hoping somebody can advise how to write a small vba script which will look at cell and determine if it has border, and on which sides?

I've tried the example from help with a few variations, but cant seem to get it working.

Any advice appreciated.
 
Hi John

Just popping back between meetings so I don't have time for a comprehensive answer. The basics would be to use the function as is, but evaluate cells surrounding rngCell. That is you pass the range to the 1st argument of the function, e.g. C10. So you could build a procedure that loops up, down, left and right, with an exist at the point at which it identifies a border...

Bit of a hasty reply but hopefully gives some direction.
 
Upvote 0

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,215,833
Messages
6,127,156
Members
449,367
Latest member
w88mp

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