Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

vba find critera

ResolvedVersion 2010

Melissa has attended:
Excel Dashboards for Business Intelligence course

VBA, Find, Critera

Hi All,

I have a large data table, with KPI's from several site/countries. (Will be imported monthly).

I want to split it into smaller tables with a country on each workbook.

Instead of manually creating a new table and finding and referencing individual cells I would like to automate it.

I've been trying IF/AND's and VLOOKUP/INDEX/MATCH but i thinks its too complicated to work, and i think i need some VBA Script instead, but it been over 6 months since my training...

I would like to create a new table, by looking for and finding data in the large table.

For example...

Look in Table1 A:A = "France" AND B:B = "Le Harve" AND C:C = "KPI-01" AND F:F = "KPI Score" if all conditions are met in that row to return Column A in that row.

The new table would continue to fill in this way with B returning Table1 B in that row, C returning Table1 C, D returning Table1 G, etc as needed in the new table.

Please help, i've been trying all day! I know that once the first bit works i'll be able to amend it accordingly for everything else.

Thank you.

RE: VBA, Find, Critera

Hi Melissa,


Thank you for the forum question.

How much VBA knowledge do you have?

You can use a decision Code (If Then Else or Select Case) to test the conditions. Loop through (Do Loop, For Next or For Each loops) can all loop through your records.

If conditions are true you can use EntireRow.copy.

Then you will need to navigate to the worksheet where you want to create the new table. A variable can be used to find the first blank row for pasting the records.

To write the code you will need to have the workbook in front of you.

I hope I have guided you in the right direction.


Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

RE: VBA, Find, Critera

Thank you Jens,

I understood VBA when i did my training, but i haven't put it into practice since then. I'll give it a go.

Kind regards,

Mel.

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Hide separate columns in Excel 2010

If you want to hide columns not adjacent to each other for example, Columns A, C and E then:-

1) Click on the fist column to be hidden i.e. A

2) Press and hold down the CTRL key

3) While holding the CTRL key, left click on the rest of the columns you want to hide i.e. C and E

4) Right click and choose Hide

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.