I am pretty new to VBA coding and currently I am working with several files that I merge into one workbook. I want to apply the formulas to every worksheet all together since they also belong in the same cell. When I try to run the code I currently have it is giving me this problem: here
I am not sure why it is adding: < ' > to the cells I'm indicating and therefore not letting the formulas to run smoothly. This is the code I have at the moment:
Sub InstacartOld()
Sheets.Select
Range("AD805").Activate
ActiveCell.FormulaR1C1 = "=SUBTOTAL(9,(AD2:AD803))"
Sheets.Select
Range("AD806").Activate
ActiveCell.FormulaR1C1 = "=SUMIF(AE2:AE803," + ",AD2:AD803)/100"
Sheets.Select
Range("AD807").Activate
ActiveCell.FormulaR1C1 = "=SUMIF(AE2:AE803," - ",AD2:AD803)/100"
Sheets.Select
Range("AG805").Activate
ActiveCell.FormulaR1C1 = "=SUM(AG2:AG803)"
Sheets.Select
Range("AH805").Activate
ActiveCell.FormulaR1C1 = "=AG805/10000"
Sheets.Select
Range("AH808").Activate
ActiveCell.FormulaR1C1 = "=AD806-AD807-AH805"
End Sub
Please any help is appreciated! hank you!
.Formulanot.FormulaR1C1Range("AD805").Formula = "=SUBTOTAL(9,(AD2:AD803))"only needs one line- skip theActivateActiveCellyou can fill all sheets immediately without loops. Only multiple sheet selection is not needed.