Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Countif Conditions - Use of conditions that vary by cell value | Excel Discussion (Misc queries) | |||
2 Conditions + Sum of a colum matching those conditions | Excel Worksheet Functions | |||
shade cells based on conditions - i have more than 3 conditions | Excel Worksheet Functions | |||
Need to Sum when THREE Conditions are met | Excel Worksheet Functions | |||
How to multiple conditions to validate more than 2 conditions to . | Excel Worksheet Functions |