Solved

Need Help With VBA Query

Posted on 2014-12-12
5
61 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
5 Comments
 

Author Comment

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

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 32

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 46

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

786 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