ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Border question (https://www.excelbanter.com/excel-programming/387329-border-question.html)

Joanne

Border question
 
I have a long spreadsheet with many customers on it.
I would like to put a line between each customer.
Problem is that each time I need it, the customers/spacing is different.
But the rows that need the line do always have a total line in it, and
they are the only rows on the spreadsheet that have a formula.
Is there a way that I can use programming to add the bottom border to
each row that has a formula in it?
Thanks a bunch for your knowledge
Joanne

Art

Border question
 
I assumed the info was in A1:A100 in Sheet2 and wrote the following code:

Sub temp()
Sheets("Sheet2").Activate
For i = 1 To 100
If Left(Cells(i, 1).Formula, 1) = "=" Then
Cells(i, 1).Borders(xlEdgeBottom).LineStyle = xlContinuous
End If
Next
End Sub

I hope this helps.

"Joanne" wrote:

I have a long spreadsheet with many customers on it.
I would like to put a line between each customer.
Problem is that each time I need it, the customers/spacing is different.
But the rows that need the line do always have a total line in it, and
they are the only rows on the spreadsheet that have a formula.
Is there a way that I can use programming to add the bottom border to
each row that has a formula in it?
Thanks a bunch for your knowledge
Joanne



All times are GMT +1. The time now is 05:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com