This thread relates to this http://www.excelforum.com/excel-prog...ed-filter.html thread I started.
I started this new thread for clarity.
Attached is a sample worksheet. I have made it small to be practical.
Essentially what my intention was is to filter the data on "Datasheet" by class. Count the number of members in each class(used to work out averages) and create a table for each class of final results variation from average etc on another sheet. In this workbook that sheet is call "SampleOut".
Any feedback ideas on the best way to acheive this is appreciated.
Thanks
Sayth
Last edited by flebber; 08-21-2010 at 12:19 AM.
I am only at the start with this trying to get the bsics right. Any opinion on the direction I am heading with this code.
Sub Fomulas() With Worksheets("Datasheet") Dim ClassCount As Integer Dim Anum, Bnum, Cnum, Dnum, Fnum As Long Dim Aavg, Bavg, Cavg, Davg As Long ' Filter by column B(Class id) .Range("B").AutoFilter Field:=1, Criteria1:="=1", Operator:=xlAnd ' Using minus 1 to ensure headers aren't counted in Row Count ClassCount = Cells(Rows.Count, "B").End(xlUp).Row - 1 FinalRow = Worksheets("Datasheet").Range(Cells("E:E"), Cells(LastRow, 5)).Cells ' Find the avg of all values in column and divide by number members Aavg = (Sum("E2:E & FinalRow")) / ClassCount ' Find the difference for each member between their score and the average Anum = ("E2:E & FinalRow") - Aavg ' Output values to sheet3 End With End Sub
Is this harder than I realise? No ideas or sugestions ? Should I really be using .net for this sort of development?
Perhaps a Pivot Table is what you need. See attached and the PivotSample sheet from your data. You can filter by class and other fields.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks