ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Conditions (https://www.excelbanter.com/excel-programming/273303-re-conditions.html)

Tushar Mehta[_6_]

Conditions
 
Not that responding to this guarantees a satisfactory resolution to
your problem, but...

What does "opposite of cell" mean?

Examples of what you want to do would not hurt.

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
I would like to create in vba the following:

If in column "X" cell equals another cell in the same column
AND
If in column "Y" cell is the opposite of cell in the same column
Then
Delete both rows

thanks in advance and best regards

Nordine


Nordine

Conditions
 
Example:

A B
1 20 10
2
3 -20 10
4
5


A1 <= A3 AND B1 = B3
Then delete Row 1 and 3

Hope this helps

thanks


Tushar Mehta wrote in message . com...
Not that responding to this guarantees a satisfactory resolution to
your problem, but...

What does "opposite of cell" mean?

Examples of what you want to do would not hurt.

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
I would like to create in vba the following:

If in column "X" cell equals another cell in the same column
AND
If in column "Y" cell is the opposite of cell in the same column
Then
Delete both rows

thanks in advance and best regards

Nordine


Tushar Mehta[_6_]

Conditions
 
OK, this is still not clear. What does <= mean? A1 = -A3 or A1 not
equal A3? I assume the first.

It is also not clear what happens if one row has 10, 20 and *two* rows
have 10, -20. Are all three to be deleted? I assume yes.

The method below is manual. If you have to do this often, you might
want to record a macro while going through the process by hand.

Suppose you have the matching values in column A and the opposite
values are in column C. Further suppose that row 1 is a header row and
the data start in row 2 and end in row 8. Finally, suppose that cols.
D onwards are empty. Obviously, you would adjust the formulas below to
suit your own layout.

Then, in D2 enter the formula =A2*10^MAX(LEN(ABS($C$2:$C$8)))&C2 and in
E2 enter the formula =A2*10^MAX(LEN(ABS($C$2:$C$8)))&-C2. Finally, in
F2 enter the formula =COUNTIF($E$2:$E$8,D2). Copy D2:F2 down to cover
all rows that have data (8 in the example).

Now, sort A:F with a key of col. F ascending. Leave the rows in F that
contain zero (they will be at the top) alone. Select all the other
rows and delete them.

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
Example:

A B
1 20 10
2
3 -20 10
4
5


A1 <= A3 AND B1 = B3
Then delete Row 1 and 3

Hope this helps

thanks


Tushar Mehta wrote in message . com...
Not that responding to this guarantees a satisfactory resolution to
your problem, but...

What does "opposite of cell" mean?

Examples of what you want to do would not hurt.

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
I would like to create in vba the following:

If in column "X" cell equals another cell in the same column
AND
If in column "Y" cell is the opposite of cell in the same column
Then
Delete both rows

thanks in advance and best regards

Nordine




All times are GMT +1. The time now is 06:07 PM.

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