Solved

Need Help With VBA Query

Posted on 2014-12-12
5
66 Views
Last Modified: 2015-01-13
I have a file where I'm trying to find all records that are associated with each other.  The criteria is as follows:
If there is a cost in column K, look at column B & C.  All preceding rows with the same value in colums B&C should be copied to Sheet 2.

Sample file attached.  Can some one help me please?
Exchange-VBA-FIle.xlsx
0
Comment
Question by:ArisaAnsar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Author Comment

by:ArisaAnsar
ID: 40497619
Please can some one help?
0
 
LVL 51

Accepted Solution

by:
Rgonzo1971 earned 250 total points
ID: 40497682
Hi,

You could use this formula to filter out the lines with zero result(array formula so enter with Ctrl-Shift-Enter)

=MAX(($B$2:$B$75=B2)*($C$2:$C$75=C2)*$K$2:$K$75)

Regards
Exchange-VBA-FIleV1.xlsx
0
 
LVL 33

Assisted Solution

by:Rob Henson
Rob Henson earned 250 total points
ID: 40500086
Assuming already sorted by columns B & C, a non-array formula in column L to show those with values, starting in L2 and copied down:

=IF(AND(B2=B1,C2=C1),L1,K2)

You can then use Auto Filter to filter in place. When you copy a filtered list only those records which are visible will be copied so can then be pasted into another list.

Alternatively, you can use Advanced Filter, this gives the option to copy to another location and can just copy certain columns if so required.

Thanks
Rob H
0
 
LVL 48

Expert Comment

by:Martin Liss
ID: 40546219
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question