help needed with VBA loop statement searchign and returning data

gwilliams

New Member
Joined
Mar 3, 2010
Messages
1
Hi,

I am looking to search a set of data using a loop statement where the returned information is reliant upon data in various columns. For example, the data below is an example of the information held.

Columns A to E have headings

Project Ref
Quote No
Quote Date
Due
No of quotes since due

Rows 1 to 13 hold data as below

Project Ref Quote no Quote Date Due No of quotes since due
100001 901234 03/01/2016 No
100002 901235 04/01/2016 No
100002 901236 04/01/2016 Yes
100002 901237 05/01/2016 No
100003 901238 10/01/2016 Yes
100003 901239 12/01/2016 Yes
100004 901240 01/02/2016 No
100005 901241 03/02/2016 No
100005 901242 04/03/2016 Yes
100005 901243 05/03/2016 No
100005 901244 15/04/2016 Yes
100006 901245 09/05/2016 No


I need to be able to loop through the project references and fill the cells in column E with the data returned from the loop.

If a project has a "due" flag set to "Yes", tell me how many quotes (count of quote No) have occurred for that particular project reference. The loop through the data to find the last instance of the project reference and exit the loop. The data above is a sample of the worksheet I am using and in some instances the same project reference occurs in 20 separate rows. The loop should also count the initial quote where the due flag is set.

As an example, project reference 100002 in A2, would return a value of 0 in E2 but a value of 2 in E3. E4 should also show 0 as it has already been counted.

Desperate for help here as its got me pickled.

Thanks all

G
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Forum statistics

Threads
1,215,375
Messages
6,124,578
Members
449,174
Latest member
chandan4057

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top