Help Copy Rows based on Cells Values Problem

purceld2

Well-known Member
Joined
Aug 18, 2005
Messages
549
Hi There

I have a problem where I need rows to a new sheet based on multiple cell values in the row. I have 5 dropdown list box where the user selects values (with the possibility that the user can select multiple values in the dropdown list box) these values are picked up by the VBA to determine which row in the data sheet to copy. The bit that is perplexing me is that in the audience dropdown list the user can select yes, which means that any row, which has a yes in the sub audience needs to be copied.

Can anybody give me a head start with the code or suggest a better solution.

Dropdown list box examples

Excel 2010
AB
1Format
2
3
4
5
6Client (Max of 5)
7
8
9
10Brand (Max 5)
11
12
13
14Published
15
16
17
18Audience
19
20
21
22

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
V1




Data

Excel 2010t<d style="border-top: 1px solid black;border-right: 1px solid black;border-bottom: 1px solid black;border-left: 1px solid black;;">Yes</d>t<d style="border-top: 1px solid black;border-right: 1px solid black;border-bottom: 1px solid black;border-left: 1px solid black;;">No</d>t<d style="border-top: 1px solid black;border-right: 1px solid black;border-bottom: 1px solid black;border-left: 1px solid black;;">No</d>
ABCDEFGHIJKLMNOPQR
1Audience< style="font-weight: bold;text-align: center;border-bottom: 1px solid black;background-color: #FFFF00;;">
2FormatClientBrandPublishedYouthMum's on the RunTradesmanFemale CommuterMale CommuterSME'sABC1C2DEHouswives with KidsMenWomen15-2435-6465+
3Case StudyMaster FoodsMars 2009NoNoNoNoNoNoNoNoNoNoNo
4Face to Face ResearchDiageoGuiness2008YesYesYesYesYesYesYesYesYesYes
5Category Insight2007NoNoNoNoNoNoNoNoNoNo
6EPOS Data2010NoNoNoNoNoNoNoNoNoNo
7Pitch
8

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet3
 

Some videos you may like

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Rijnsent

Well-known Member
Joined
Oct 17, 2005
Messages
1,298
Office Version
  1. 365
Platform
  1. Windows
Hey Purceld2,

if it doesn't matter for you in which column of the audience block the "yes" is located, I would probably use a helper column. An extra column with a formula to determine if there is a "Yes" in any of the Audience cells. An alternative is to make that helper column but basically make one long string of your "audience" data. So that could be "NoNoNoNoNoYesYesYes". Next, if the user fills in "Yes" to filter upon, you could filter on "*"&users choice & "*".

Hope those pointers help,

Koen
 

purceld2

Well-known Member
Joined
Aug 18, 2005
Messages
549
Thanks Rijnsent,

Your advice is very much appreciated.

Just one thing that I am not clear is how could I filter on "*"&users choice & "*", could you elaburate please.

Kind Regards
Desmond
 

Rijnsent

Well-known Member
Joined
Oct 17, 2005
Messages
1,298
Office Version
  1. 365
Platform
  1. Windows
Hey Desmond,

okay, say you add that column with all the columns "together". E.g. with a formula like =E3&F3&G3&H3&I3&J3 etc. That would mean "NoNoNoNoNoNo". If you filter that column with a text filter that "Contains" "Yes", it does filter all the rows where there is "Yes" in any of your columns.
So basically the *-s mean the "contains" filter: if you filter on "*Yes*" all strings that contains a Yes will be filtered.

Hope that helps,

Koen
 

purceld2

Well-known Member
Joined
Aug 18, 2005
Messages
549
Hey Desmond,

okay, say you add that column with all the columns "together". E.g. with a formula like =E3&F3&G3&H3&I3&J3 etc. That would mean "NoNoNoNoNoNo". If you filter that column with a text filter that "Contains" "Yes", it does filter all the rows where there is "Yes" in any of your columns.
So basically the *-s mean the "contains" filter: if you filter on "*Yes*" all strings that contains a Yes will be filtered.

Hope that helps,

Koen

Thank you
 

Watch MrExcel Video

Forum statistics

Threads
1,108,960
Messages
5,525,904
Members
409,671
Latest member
nasseralateek

This Week's Hot Topics

Top