Dear Excel Users
I am trying to write a VBA macro, which can create a worksheet with content. When this macro has been executed one time it won't be used anymore. The resulting worksheet should work on its own.
I am unsure how to create formulas in the worksheet. Let's assume I wanted to place the formula "sum(A1:A5) in cell B4. Then I would just write the following in a code line:
Cells(4,2) = "=sum(A1:A5)"
The formulas are however not fixed as in the above example, but depends on user input. Suppose the user has delivered information about what cells to sum and what place to put that formula. Let's say I have defined two variables FR and FC containing the row and the column of the cell to place the formula, and suppose I have defined variables FromR, FromC, ToR and ToC specifying the range to sum. How do I write a code line to place the userspecified formula in the userspecified cell? I mean I can't just replace A1 and A5 with the userspecified range ...
I hope someone can help solving this problem. I have considered the possibility of using names for ranges.
Regards,
Erik
Bookmarks