Putting border around 5 cells and 5,000 rows ?

tcurrier

Board Regular
Joined
Apr 27, 2006
Messages
175
Hi,

I have a spreadsheet where I need to put a border around 5 cells across and 5,000 rows down.... The only way I can figure out how to do it is to highlight the 5 cells, and drag all the way down to the 5,000th row. Then click 'format cells', 'border', 'outline'...... I also have other groups of cells on the same spreadsheet that I need to do the same thing with.

Can anyone save me about 1/2 hour of work with an easy way to do this ?

Thanks !
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
What range do you want to do this formatting in?

Let's say it's A1:E5000.

In the name box, to the left of the formula bar, just enter A1:E5000.

That should select the required range which you should be able to format via the Format... menu.
 
Upvote 0
I tried that, but it doesn't seem to work...

I put A1:G10 in the 'name' box.... then clicked 'Format', 'Cells'....
but the A1:G10 goes away as soon as I click the 'Format' button .....
 
Upvote 0
Try pressing Enter after you've put the range in the Name Box.
 
Upvote 0
Or since this sounds like something done regularly, you may be interested in a quick
little one liner in vba.

Assumes the ranges will stay the same, and you want just a standard black border.
Code:
Sub BorderMe()
Range("A1:E5000, G1:H10").BorderAround LineStyle:=xlContinuous
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,912
Messages
6,122,204
Members
449,072
Latest member
DW Draft

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