mercredi 31 décembre 2014

How to query an Excel Worksheet using VBA

I have an excel sheet where I need to enter code to query a separate excel document. It will search column A in the second sheet for each of 7 names. When searching for name 1, each time it finds name 1 in col A, if col B equals E, increment in A1 of the first sheet. So basically, every time my name shows up (which is listed randomly in col 1 of the second excel doc), if E is listed in col 2 next to my name, mark that in the first sheet. I need to find the total number of times my name and E match up. Hope that makes sense. Below is a sample.


.....Col A.....Col B............Col C.......Col D.......Col E.....Col F..........Col G.......Col H

1...Name..Calls Offered..Calls...Abandoned..Abn %..Out Calls..Out Time..Staff Time

2 Person A.......6...............6..............0..............0...........19.........0:04:17.....9:16:43

3 Person B.......4...............3..............1.............25..........19.........0:03:07.....8:14:13

4 Person C.......2...............2..............0..............0...........4...........0:05:26.....4:30:05


Sorry it won't let me post a picture... I need the code to be able to query for every instance that Person A shows up in a list. Every time A shows, I need it to take the value in col B and add it to a running total, col C and add it to a different running total, and so on and so forth. Hope this makes more sense.


Aucun commentaire:

Enregistrer un commentaire