98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel VBA Training and help » VBA, Find, Critera
VBA, Find, Critera
Resolved · High Priority · Version 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
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
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Use RANDBETWEEN to generate random numbersThere may be occassions where you need to generate random numbers in your spreadsheet. Use the RANDBETWEEN function to generate random numbers between two values that you specify. |