Custom Borders for a group of cells

AlanaT

New Member
Joined
Feb 20, 2019
Messages
4
Using Excel 2010... can you create a custom border that affects a group of cells, i.e. cells C3:E6, all inside borders in cell group have standard line borders, and the outer borders (surrounding the group of cells) are thick outside borders. I do this all the time and would like a one-step/one-click solution.
See below picture.
Capture.PNG
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,512
Office Version
  1. 365
Platform
  1. Windows
How about
VBA Code:
Sub AlanaT()
   With Range("C3:E6")
      .Borders.Weight = xlThin
      .BorderAround , xlMedium
   End With
End Sub
 

AlanaT

New Member
Joined
Feb 20, 2019
Messages
4
This cell range was only an example... wouldn't using that VBA code only border those specific cells. I would like to have the custom border for whatever range of cells I select.
Does that make sense?
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,512
Office Version
  1. 365
Platform
  1. Windows
In that case you can use
VBA Code:
Sub AlanaT()
   With Selection
      .Borders.Weight = xlThin
      .BorderAround , xlMedium
   End With
End Sub
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,512
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,129,452
Messages
5,636,340
Members
416,914
Latest member
DWC199

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
Top