View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Otto Moehrbach Otto Moehrbach is offline
external usenet poster
 
Posts: 1,090
Default Searching and displaying records that match criteria.

D
Just off the top of my head, I would suggest a loop (Do or For loop),
something like the following:
First, make sure the data in the Master Data is sorted by the 3 fields you
site. All three. You could just add that to the beginning of the code.
Loop through all the Supplier Data and search for the first and last
instance of the Supplier No. in the Master Data range.
Set a range from this first to last Supplier No. to the variable SupplierNo.
Search the range SupplierNo.Offset(,1) for the first and last instances of
Product No. and set that range to the variable ProductNo.
Search the range ProductNo.Offset(,1) for the SiteNo.
If found, compare and copy as you wish.
Post back if this sounds promising and/or you need more. Otto

"D Zandveld" wrote in message
...
Hello again.

Experience level:
Good to Advanced in both Excel and VBA, i'm just stuck where to start!

I have 2 worksheets: Master Data and Supplier Data

Master Data contains information downloaded from our business warehouse:
Supplier no (key field 1)
Product no (key field 2)
Site no (key field 3)
Current price
Currency
Trading terms

Supplier Data contains pricing info from suppliers
Supplier no (key field 1)
Product no (key field 2)
Site no (key field 3)
Price - revised
Payment terms - revised
Currency
Trading Terms - revised

I want to produce a report based on the following logic:
IF
Supplier Data!Supplier no + Product no + Site no are found in Master Data,
THEN
compare based on price, terms (+ other criteria)
THEN
copy changes to 'Changes Report' worksheet.
(fields Supplier no, Product no, Site no, Old price, New price, Old terms,
%
change, new terms)

The result would be a report that shows all the line items that have
changed.

If more clarification is required, please let me know and I will deliver.

Thanks