L
Legacy 323112
Guest
Hi all,
I am trying to do the following with VBA and have had some trouble, would appreciate any ideas;
- I have an array of data in my excel spreadsheet (range("A2:D401").
- In column D2, I am performing a calculation of B2 minus C2. This formula extends for each row until row 401.
- Once calculated, I want to generate a new sheet with a list of only the values in columns A, E and F for only the records that have values in column D that are less than or equal to 150. This is to be looped and so I would like this list, if generated, to be appended to each time.
Please help!
Thanks
Example;
In this example, I would like an output in another spreadsheet of "JOHN" "TYPE-2" "AGE-20", because NUMBER3 for JOHN is <150
However, there should be no output of MARY.
[TABLE="width: 651"]
<tbody>[TR]
[TD="class: xl65, width: 93"][/TD]
[TD="class: xl65, width: 93"]A[/TD]
[TD="class: xl65, width: 93"]B[/TD]
[TD="class: xl65, width: 93"]C[/TD]
[TD="class: xl65, width: 93"]D[/TD]
[TD="class: xl65, width: 93"]E[/TD]
[TD="class: xl65, width: 93"]F[/TD]
[/TR]
[TR]
[TD="class: xl65"]1[/TD]
[TD="class: xl65"]NAME[/TD]
[TD="class: xl65"]NUMBER 1[/TD]
[TD="class: xl65"]NUMBER 2[/TD]
[TD="class: xl65"]NUMBER 3[/TD]
[TD="class: xl65"]TYPE[/TD]
[TD="class: xl65"]AGE[/TD]
[/TR]
[TR]
[TD="class: xl65"]2[/TD]
[TD="class: xl65"]JOHN[/TD]
[TD="class: xl65"]200[/TD]
[TD="class: xl65"]12[/TD]
[TD="class: xl65"]88[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl65"]20[/TD]
[/TR]
[TR]
[TD="class: xl65"]3[/TD]
[TD="class: xl65"]MARY[/TD]
[TD="class: xl65"]200[/TD]
[TD="class: xl65"]10[/TD]
[TD="class: xl65"]190[/TD]
[TD="class: xl65"]3[/TD]
[TD="class: xl65"]22[/TD]
[/TR]
</tbody>[/TABLE]
I am trying to do the following with VBA and have had some trouble, would appreciate any ideas;
- I have an array of data in my excel spreadsheet (range("A2:D401").
- In column D2, I am performing a calculation of B2 minus C2. This formula extends for each row until row 401.
- Once calculated, I want to generate a new sheet with a list of only the values in columns A, E and F for only the records that have values in column D that are less than or equal to 150. This is to be looped and so I would like this list, if generated, to be appended to each time.
Please help!
Thanks
Example;
In this example, I would like an output in another spreadsheet of "JOHN" "TYPE-2" "AGE-20", because NUMBER3 for JOHN is <150
However, there should be no output of MARY.
[TABLE="width: 651"]
<tbody>[TR]
[TD="class: xl65, width: 93"][/TD]
[TD="class: xl65, width: 93"]A[/TD]
[TD="class: xl65, width: 93"]B[/TD]
[TD="class: xl65, width: 93"]C[/TD]
[TD="class: xl65, width: 93"]D[/TD]
[TD="class: xl65, width: 93"]E[/TD]
[TD="class: xl65, width: 93"]F[/TD]
[/TR]
[TR]
[TD="class: xl65"]1[/TD]
[TD="class: xl65"]NAME[/TD]
[TD="class: xl65"]NUMBER 1[/TD]
[TD="class: xl65"]NUMBER 2[/TD]
[TD="class: xl65"]NUMBER 3[/TD]
[TD="class: xl65"]TYPE[/TD]
[TD="class: xl65"]AGE[/TD]
[/TR]
[TR]
[TD="class: xl65"]2[/TD]
[TD="class: xl65"]JOHN[/TD]
[TD="class: xl65"]200[/TD]
[TD="class: xl65"]12[/TD]
[TD="class: xl65"]88[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl65"]20[/TD]
[/TR]
[TR]
[TD="class: xl65"]3[/TD]
[TD="class: xl65"]MARY[/TD]
[TD="class: xl65"]200[/TD]
[TD="class: xl65"]10[/TD]
[TD="class: xl65"]190[/TD]
[TD="class: xl65"]3[/TD]
[TD="class: xl65"]22[/TD]
[/TR]
</tbody>[/TABLE]
Last edited by a moderator: