K
kittronald
I'm trying to programmatically delete columns based on a criteria.
If A1=1 and B1=2, do nothing.
If A1=1, B1<>2, C1<>2 and D1=2, delete columns B:C.
I could test with the following:
If Application.Match(1, Range("Sheet1!$1:$1"), 0) -
Application.Match(2, Range("Sheet1!$1:$1"), 0) > 1 Then
But I don't see how to form:
.Columns("B:C").Delete
- Ronald K.
If A1=1 and B1=2, do nothing.
If A1=1, B1<>2, C1<>2 and D1=2, delete columns B:C.
I could test with the following:
If Application.Match(1, Range("Sheet1!$1:$1"), 0) -
Application.Match(2, Range("Sheet1!$1:$1"), 0) > 1 Then
But I don't see how to form:
.Columns("B:C").Delete
- Ronald K.