Fill Across Border Settings

FrenchCelt

Board Regular
Joined
May 22, 2018
Messages
214
Office Version
  1. 365
Platform
  1. Windows
Hello,

I'm trying to code a border setting that will carry across the entire range of data. I'll give the starting point from Column A:

Thick Outside Border around A2
Thick Outside Border around A3:A9
All Borders (Thin Lines) within A10:A13
Thick Outside Border around A10:A15

And then these settings should fill across to the end of the data in whatever column that may be (varies every day).

Any help would be greatly appreciated.
 
This is a snippet of what it looks like when done manually.

1607376747030.png
 
Upvote 0

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Closer?

VBA Code:
Sub FrenchCelt3()
    Dim i As Long, myCell As Range
    Application.ScreenUpdating = False

    i = Rows("2:15").Find("*", , xlValues, xlPart, xlByColumns, xlPrevious, False).Column

    Rows("2:15").Borders.LineStyle = xlNone
    
    Range(Cells(2, "A"), Cells(2, i)).Borders.Weight = xlThick
    
    For Each myCell In Range(Cells(3, "A"), Cells(3, i))
        myCell.Resize(7).BorderAround , Weight:=xlThick
    Next
    
    For Each myCell In Range(Cells(10, "A"), Cells(10, i))
        myCell.Resize(4).Borders.Weight = xlThin
    Next
    
    For Each myCell In Range(Cells(10, "A"), Cells(10, i))
        myCell.Resize(6).BorderAround , Weight:=xlThick
    Next
    
    Application.ScreenUpdating = True
 
Upvote 0
Solution
Bingo, you hit it right on the nose this time. Thank you so much! I appreciate you taking the time to help me out.
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,592
Members
449,089
Latest member
Motoracer88

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