tmvds
03-27-2016, 04:29 PM
Hi everyone, I am new to VBA and would really appreciate some advice with this task.
I have a database with a changing number of entries per day (column A - some days 5 entries, others 20 etc).
I need to find and copy into a new sheet the entire row, for each day, for the first entry that has a value in column B which is lower & greater than a threshold (let's say 70%).
To be clear, let's suppose 28th March has 5 entries and 29th March 3 entries:
1 28/03 90% A
2 28/03 73% B
3 28/03 68% C
4 28/03 65% D
5 28/03 50% E
6 29/03 74% F
7 29/03 50% G
8 29/03 65% H
I need the VBA code to find the first value above (73%) and below (68%), and copy these entire 2 rows in a new sheet. Then move on to 29/03, and copy rows 6 & 8 into the new sheet. The final result in the new sheet should be:
2 28/03 73% B
3 28/03 68% C
6 29/03 74% F
8 29/03 65% H
Any suggestion?
Thanks a lot for your help.
I have a database with a changing number of entries per day (column A - some days 5 entries, others 20 etc).
I need to find and copy into a new sheet the entire row, for each day, for the first entry that has a value in column B which is lower & greater than a threshold (let's say 70%).
To be clear, let's suppose 28th March has 5 entries and 29th March 3 entries:
1 28/03 90% A
2 28/03 73% B
3 28/03 68% C
4 28/03 65% D
5 28/03 50% E
6 29/03 74% F
7 29/03 50% G
8 29/03 65% H
I need the VBA code to find the first value above (73%) and below (68%), and copy these entire 2 rows in a new sheet. Then move on to 29/03, and copy rows 6 & 8 into the new sheet. The final result in the new sheet should be:
2 28/03 73% B
3 28/03 68% C
6 29/03 74% F
8 29/03 65% H
Any suggestion?
Thanks a lot for your help.