graemeal
Active Member
- Joined
- May 17, 2007
- Messages
- 316
- Platform
- Windows
I have 2 columns shown below, column C and column D. Both columns have formulas in them already. I now sort column D from largest to smallest by a macro.
I would like create a condition in another macro that changes the value in column D to 0 if the value opposite in C column is less than 0, then sort from largest to smallest.
C D
%%% Gain
2 -1.34 2.30
3 3.61 2.15
4 -3.72 1.67
5 -4.05 1.50
6 0.76 1.20
7 5.60 1.10
So the macro would change D2, D4, and D5 to zero then Sort D from largest to smallest would produce the bottom example.
C D
%%% Gain
2 3.61 2.15
3 0.76 1.20
4 5.60 1.10
Ideally I would like to reverse that via another Macro.
I would like create a condition in another macro that changes the value in column D to 0 if the value opposite in C column is less than 0, then sort from largest to smallest.
C D
%%% Gain
2 -1.34 2.30
3 3.61 2.15
4 -3.72 1.67
5 -4.05 1.50
6 0.76 1.20
7 5.60 1.10
So the macro would change D2, D4, and D5 to zero then Sort D from largest to smallest would produce the bottom example.
C D
%%% Gain
2 3.61 2.15
3 0.76 1.20
4 5.60 1.10
Ideally I would like to reverse that via another Macro.