1

What is the best/easiest way to search through data from two Excel tabs on the same spreadsheet. To see if the field is on another tab. For example, on tab 1 there is a list of fruit and vegetables. On the second tab, there is a list of just fruits but there are some left off the second tab. I need a code that searches tab 2 and lets me know which info is not on the second tab compared to what is on tab 1.

I have similar code I have created but the code is for SQL and I am not familiar with how this should look in excel -

SELECT Team, Collector_Name, TopParent_Reporting, TopParent_Reporting_Name, Period, [Year], 
CASE WHEN (SUM(Amount_Paid)) <> 0 THEN 
(SUM(Weight_Rcpt_Trans))/(SUM(Amount_Paid)) ELSE NULL END 
AS TTP FROM arrt.tblTimeToPay_Abbreviated_PeriodA AS TTP    
WHERE TopParent_Reporting_Name LIKE 'Green Fruit%'  
GROUP BY Team, Collector_Name, TopParent_Reporting, TopParent_Reporting_Name, Period, [Year]    
ORDER BY [Year] DESC, Period DESC, TopParent_Reporting 
Raystafarian
  • 21,963
  • 12
  • 64
  • 91

1 Answers1

1

No need for VBA.

If your list is on Sheet1 and you want to see what on Sheet1 is not on Sheet2 you can use this formula in column B of Sheet1 -

=IFERROR(MATCH(A1,Sheet2!$A$1:$A$10,0),"Not Found")

It will return the row number from sheet 2 if found, otherwise it will tell you what's not found.

Now, if you have your fruits and vegetables categorized, then it might make more sense to use VBA.

Raystafarian
  • 21,963
  • 12
  • 64
  • 91