Hey everyone. Very new to coding. I have a spreadsheet that we use to track employee stats each week and we keep a running total of their performance from previous weeks along with their current perfomance on each sheet. Typically we used to just copy the last sheet and then manually add the totals from the previous week into this weeks total and then manually delete everything but I found that quite tedious so I have figured out some code to copy over their total from the previous week and add it to their running total and then reset the data for this week but I need to figure out how to loop it to the next row. My only issue is employees are grouped by type (full time, part time, etc.) so there are some merged rows that would need to be skipped. The code I have so far is as follows:
Range("J3").Value = Range("C3").Value + Range("G3").Value
Range("j3").Select
Selection.Cut Range("G3")
Range("K3").Value = Range("D3").Value + Range("H3").Value
Range("K3").Select
Selection.Cut Range("H3")
Range("I3").Value = Range("H3").Value / Range("G3").Value
Range("C3:D3").SpecialCells(xlCellTypeConstants, 23).Clear
but that only works for row 3 and I need it to go to row 34 currently. Also I need it to be able to skip over blank cells as sometimes empoloyees don't work and so won't have a weekly target and currently it returns an error on the last line (when it clears) if the cell is already blank.
Much thanks for your help.
Range("J3").Value = Range("C3").Value + Range("G3").Value
Range("j3").Select
Selection.Cut Range("G3")
Range("K3").Value = Range("D3").Value + Range("H3").Value
Range("K3").Select
Selection.Cut Range("H3")
Range("I3").Value = Range("H3").Value / Range("G3").Value
Range("C3:D3").SpecialCells(xlCellTypeConstants, 23).Clear
but that only works for row 3 and I need it to go to row 34 currently. Also I need it to be able to skip over blank cells as sometimes empoloyees don't work and so won't have a weekly target and currently it returns an error on the last line (when it clears) if the cell is already blank.
Much thanks for your help.