Dynamic Boarders Macro, I need assistance to modify macro to allow for varying boarder thickness

bootj1234

Board Regular
Joined
Aug 27, 2012
Messages
85
The following macro allows me to set a dynamic boarder range around the cells that have data in them. A modification to the macro that I need help with is code that would allow me to maintain the dynamic capability, but with thick black color boarders that run around the following areas, instead of the thin black color borders:
• Along the top edge of cells G11:J11, and
• Along the left edge of cells in columns G and J, and
• Along the right edge of cells in cloumn J

Sub DynamicRangeBorders_2()
Dim StartCell As Range
Set StartCell = Range("A11")
Cells.Borders.LineStyle = xlNone
StartCell.CurrentRegion.Borders.LineStyle = xlContinuous
End Sub

Here is an image of the data and range with the thin line black boarders applied by the above macro.

Thanks, John

Excel 2013/2016
ABCDEFGHIJ
Geva
Geva

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]11[/TD]
[TD="align: center"]Client[/TD]
[TD="align: center"]Location/
Network(s)[/TD]
[TD="align: center"]Campaign Name[/TD]
[TD="align: center"]No. Of
Posn[/TD]
[TD="align: center"]No. Of
Spots[/TD]
[TD="align: center"]Spot Name[/TD]
[TD="align: center"]Video
Ad Time
Length[/TD]
[TD="align: center"]Airtime
Start Date[/TD]
[TD="align: center"]Airtime
End Date[/TD]
[TD="align: center"]Campaign
End Date[/TD]

[TD="align: center"]12[/TD]

[TD="align: center"]EVM[/TD]
[TD="align: center"]2017-2018 Season[/TD]
[TD="align: center"]0.5[/TD]
[TD="align: center"]26 of 29[/TD]
[TD="align: center"]House Over [/TD]
[TD="align: center"]15.0[/TD]
[TD="align: center"]03/26/18[/TD]
[TD="align: center"]04/02/18[/TD]
[TD="align: center"]06/30/18[/TD]

[TD="align: center"]13[/TD]

[TD="align: center"]EVM[/TD]
[TD="align: center"]2017-2018 Season[/TD]
[TD="align: center"]0.5[/TD]
[TD="align: center"]26 of 29[/TD]
[TD="align: center"]House Over[/TD]
[TD="align: center"]15.0[/TD]
[TD="align: center"]03/26/18[/TD]
[TD="align: center"]04/02/18[/TD]
[TD="align: center"]06/30/18[/TD]

</tbody>
EVM - Finished Report
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Try
Code:
Sub DynamicRangeBorders_2()
Dim StartCell As Range
Set StartCell = Range("A11")
Cells.Borders.LineStyle = xlNone
With StartCell.CurrentRegion
   .Borders.LineStyle = xlContinuous
   .BorderAround , xlThick
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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