Hello,
I'm writing this macro to cycle and calculate our monthly insurance contribution:
Application.Goto Reference:="Ending_Balance"
Selection.Cut
Range("AF3").Select
ActiveSheet.Paste
Application.Goto Reference:="Ending_Hours"
Selection.Cut
Range("AD3").Select
ActiveSheet.Paste
Range("AE3").Select
ActiveCell.FormulaR1C1 = "=RC[-1]+RC[-25]"
Range("AE3").Select
Selection.Copy
Range("AE4:AE200").Select
ActiveSheet.Paste
Range("AG3").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=IF(RC[-2]>=140,RC[-1]+RC[-26]-RC[-28],RC[-1]-14)"
Range("AG3").Select
Selection.Copy
Range("AG4").End(xlUp).Select
ActiveSheet.Paste
"Ending_Balance" and "Ending_Hours" are just long sections of those columns to ensure it will always copy as we hire new employees. When I move them over and have the formulas run through, I only want to copy the formulas (AE3 & AG3) down as far as there are rows on the sheet so I don't have a bunch of N/A cells at the bottom. I've tried doing .End(xlDown), but since the cells are empty, it doesn't work obviously. Is there a way to do this using Offset? I tried using Offset(0,-10), but it took me to the bottom of the sheet. How do I paste from cell AE4 to the last row of an empty column using another column as a reference for the last row? Thanks!
I'm writing this macro to cycle and calculate our monthly insurance contribution:
Application.Goto Reference:="Ending_Balance"
Selection.Cut
Range("AF3").Select
ActiveSheet.Paste
Application.Goto Reference:="Ending_Hours"
Selection.Cut
Range("AD3").Select
ActiveSheet.Paste
Range("AE3").Select
ActiveCell.FormulaR1C1 = "=RC[-1]+RC[-25]"
Range("AE3").Select
Selection.Copy
Range("AE4:AE200").Select
ActiveSheet.Paste
Range("AG3").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=IF(RC[-2]>=140,RC[-1]+RC[-26]-RC[-28],RC[-1]-14)"
Range("AG3").Select
Selection.Copy
Range("AG4").End(xlUp).Select
ActiveSheet.Paste
"Ending_Balance" and "Ending_Hours" are just long sections of those columns to ensure it will always copy as we hire new employees. When I move them over and have the formulas run through, I only want to copy the formulas (AE3 & AG3) down as far as there are rows on the sheet so I don't have a bunch of N/A cells at the bottom. I've tried doing .End(xlDown), but since the cells are empty, it doesn't work obviously. Is there a way to do this using Offset? I tried using Offset(0,-10), but it took me to the bottom of the sheet. How do I paste from cell AE4 to the last row of an empty column using another column as a reference for the last row? Thanks!