underline bottom row

methody

Well-known Member
Joined
Jun 17, 2002
Messages
857
Hello there
I want the bottom row of my range of cells to have a border along the bottom

I have a range of cells - top left cell F6 - which is 5 columns wide but with a variable numbers of rows. The numbers of rows is determined by how many entries are made in C6 down.
F6 has a simple IF formulas - IF(C6="","",C6)
F7 has a simple IF formulas - IF(C7="","",C7)
So if there is only one entry in the C column there will only be one row in my range and the border is put under the cells F6- J6
So if there are 2 entries in the C column (C6,C7) there will only be one row in my range and the border is put under the cells F7- J7

Using current region is no good as it include those cells with formulas.

Any help appreciated
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
You could use conditional format for that.

Select columns F:J

Go to conditional format. If you have 2007+, select "Use a formula to determine..." and enter the following formula

=(ROW($F1)>=6)*(LEN($C1)>0)*(LEN($C2)=0)

Click the "Format" button and put a bottom border. Click OK, and you're done.
 
Upvote 0
Apologies Juan
I have been using conditional formatting but have been having compatability issues and so want to use code instead.
 
Upvote 0
I've used that trick since Excel 2000, so you shouldn't have an issue with it. With code you'll have to clear borders before as well, so keep that in mind.
 
Upvote 0
OK thank you
Its just that I have a workbook save in Excel 2003 with this sort of condiftional formattting but when another person uses it who has 2010 they have a problem when it comes to saving and the problem points to the condtional formatting.
 
Upvote 0

Forum statistics

Threads
1,224,585
Messages
6,179,703
Members
452,938
Latest member
babeneker

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