#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Countif Conditions - Use of conditions that vary by cell value JonTarg Excel Discussion (Misc queries) 1 May 30th 08 01:21 PM
2 Conditions + Sum of a colum matching those conditions Jeffa Excel Worksheet Functions 5 June 8th 07 12:14 AM
shade cells based on conditions - i have more than 3 conditions Mo2 Excel Worksheet Functions 3 March 30th 07 07:19 AM
Need to Sum when THREE Conditions are met jimswinder Excel Worksheet Functions 7 July 24th 06 08:03 PM
How to multiple conditions to validate more than 2 conditions to . Bhuvana Govind Excel Worksheet Functions 1 January 28th 05 07:07 PM


All times are GMT +1. The time now is 02:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"