ceb

New Member
Joined
May 5, 2011
Messages
14
Hi all,

I have a macro I created to add boarders around a table shown below.
The last line
BorderAround Weight:=xlThick makes the last cell of the worksheet one cell below the last one actually used. I cannot clear this. of I change it to
BorderAround Weight:=xlThin it works fine but the table does not look as good. If I select the table and use the thick boarder icon it works fine.
Can anybody please explain why this happens.
I does not matter most of the time but I have other macros that need to find the last cell used which makes them not work they find the incorrect last cell. I have tried utilities which reset the last cell but they also don't work.
So I need some help.

Sub Boxit()
'
' Boxit Macro
'
'
With Selection
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders.LineStyle = xlNone
.Borders.Weight = xlThin
.BorderAround Weight:=xlThick
End With
End Sub

Cheers Clive
 
Last edited:

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,215,635
Messages
6,125,942
Members
449,275
Latest member
jacob_mcbride

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