Inserting data into a sheet according to criteria

L

lemonpillows

Hi,

I've been trying to work out an excel problem for days and days, googled
till I could google no more, and still haven't found the answer, so I
was hoping you could help..

I have a spreadsheet with a list of peoples names, addresses, postcodes
etc. (stafflist)

I have another ten or twenty spreadsheets with postcode data on them.
The postcodes refer to government funded areas.

I have set up the sheets (postcodearea1, postcodearea2) with all the
applicable postcodes, and have managed to get a column to look through
the 'stafflist' sheet, to find if there are any of those postcodes in
teh 'stafflist' sheet, and count how many.

For example:

Area Postcode Count
Beckfield TS6 4BG 2
Beckfield TS6 4BH 0

etc etc

I've done this with a 'Count If('Stafflist!$B$2:$B$144, xxx')' formula.

What I want to do, is for excel, when it finds an instance of the
specified postcode in 'stafflist', to bring the corresponding data
across (name, date of birth, address) and 'deposit' it in either the
same (postcodearea) sheet, or on a new sheet.

Eg:
If

//If the postcode on postcodearea cell B2 exists in the stafflist sheet
//column B
(stafflist!$B$2:$B$114,B2)

//Add number of instances to 'count' column in 'postcodearea' sheet
count=count++

//Then, take all the data in the row(s) containing the corresponding
postcode(s) and put it all on a sheet called 'fundedstaff'
copy stafflist!$ref$ to fundedstaff!

I would want the information from the 'postcodearea' sheet to be in the
first two/three columns of the sheet, then the personal information to
be in teh next columns along teh row.

Is there any way this can be done at all?? I've never used VisualBasic
before, but I've done Java and C#, so I understand programming concepts,
but have no idea when it comes to VB. I'd be really grateful if someone
could help me wiht this.. It would save me days and days worth of work
each month..

I hope someone can help..

Thanks

lemonpillows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top