Borders Around Cell Fill Down

Vlr516

New Member
Joined
Sep 11, 2017
Messages
22
This forum has been wonderful helping me learn about macros and vba. I come back to the group to see if I can get assistance on how to fill down a border to the last row.

On a pre-designed template with the All Borders around each cell beginning row 6 - row 27 to column H. My macro brings data in from multiple other sheets and sometimes the final Row on the activesheet is longer than what was preformatted. Once I have all the data into place on my activesheet, how do I write the code to grab only the border from A6:H6 and fill down to the Finalrow?

Thanks.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Try:
Code:
Sub CopyBorders()
    ActiveWorkbook.Styles("Normal").IncludeBorder = False
        Range("A6:H6").Copy
        With Range("A7:H" & Range("A" & Rows.Count).End(xlUp).Row)
            .PasteSpecial -4122
            .Style = "Normal"
        End With
    ActiveWorkbook.Styles("Normal").IncludeBorder = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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