how do you add formulas on multiple excel sheets

U

undercoverangeltn

I need to add several formulas on several different Excel spreadsheets and
not necessarily in the same cell or column. Is there a way to do this?
 
J

Jim May

With code lines, like so:
with numbers in A1:A4 (1,2,3,4)

Sub Foo()
sheets("sheet1").range("A5").Formula = "=Sum(A1:A4)"
sheets("sheet2").range("A1").Formula = "='Sheet1'!A5"
End Sub
 
Top