Hi Guys,

I am trying to work out a way to have a button on one work sheet that will execute a function that goes through the data in another sheet and brings across data based on 1 set of criteria then sums that data and puts the sum in a different column of second sheet based on a column with account codes in the first sheet. I have tried to explain this in as best I can below using sheet names and identifying rows, columns and criteria. Is someone able to tell me if this is possible I am very new to macros and am bumbling around forums, google and youtube trying to work this out. Would definitely appreciate some help here.

I would need Columns A, B and F copied from "costs" worksheet to "bal" worksheet. Columns A and B of "costs" would be entered into the next available row in Columns A & B of "bal" column F of "costs" would be entered into one of columns H:AU (same row as where data for column A and B have already been placed) based on the value in column J of "Costs" matching the value in row 4 of columns H:AU of "bal".

I would then need the sum(H:AW) (of the corresponding row) to be entered into one of columns D, E or F dependent on the value in column G. If "310" or "311" are in column G of costs the sum (calculated above) would be placed in column F of bal. If "312" or "313" are in column G of "costs", the sum (calculated above) would be placed in column D of bal. If "314" is in column column "G", the sum (calculated above) would be placed in column E of bal.

I will be updating the "costs" spreadsheet's data every 2 weeks and it would be cool if the macro could pick up from the last row it entered the previous time it was executed.

Again, not sure if this is possible and definitely appreciate anyone's help on this.

Cheers