ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA to insert .xlborder if cell value not equal to previous cell (https://www.excelbanter.com/excel-programming/442836-vba-insert-xlborder-if-cell-value-not-equal-previous-cell.html)

Forgone

VBA to insert .xlborder if cell value not equal to previous cell
 
I've got a worksheet and I'm wondering whether it is possible to
insert a line when a value in Column A, B, C & D does not equal the
values in the row above or below it.

I've currently got a formula in Column A that reads....
=IF(AND(B3=B2,C3=C2,D3=D2,E3=E2),"","IL") and a conditional format
that if the cell value is equal to "IL" then put a border. Wondering
if there is a better way to do this via VBA or is that the better way?

Steve Dunn

VBA to insert .xlborder if cell value not equal to previous cell
 
In your conditional formatting formula, instead of

=A1="IL"

(which I assume is what you've got)

Use:

=OR(B3<B2,C3<C2,D3<D2,E3<E2)



"Forgone" wrote in message
...
I've got a worksheet and I'm wondering whether it is possible to
insert a line when a value in Column A, B, C & D does not equal the
values in the row above or below it.

I've currently got a formula in Column A that reads....
=IF(AND(B3=B2,C3=C2,D3=D2,E3=E2),"","IL") and a conditional format
that if the cell value is equal to "IL" then put a border. Wondering
if there is a better way to do this via VBA or is that the better way?




All times are GMT +1. The time now is 04:39 PM.

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