Thread: Adding A Formula From One Cell To Another Cell (2003)

1. Adding A Formula From One Cell To Another Cell (2003)

Scenario: I have a formula in cell A1 that includes 2 links to 2 cells on 2 other worksheets in the same workbook. I would like to add a a linkthat is in cell B1 to the formula in cell A1. Any ideas?

2. Re: Adding A Formula From One Cell To Another Cell (2003)

Not sure I completely understand. What kind of "links" are you talking about? A cell can only have 1 hyperlink. Are you talking about dependent cells or what?

To have in B1 a display of the formula from A1 you can add the UDF into a module:
<pre>Function Getformula(rng As Range)
Getformula = rng.Cells(1).Formula
End Function</pre>

Then in B1 enter:
<pre>=GetFormula(a1)</pre>

Steve

3. Re: Adding A Formula From One Cell To Another Cell (2003)

Thanks, Steve. Let me try to explain it a little more clearly: In cell A1 on Sheet 1 of Workbook "Book 2" I have the formula "=Sheet2!B1+Sheet3!C1". In cell B1 I have the formula "=Sheet4!B1". I would like to add the formula in cell B1 to the formula in cell A1. Hopefully this is a little more clear.

4. Re: Adding A Formula From One Cell To Another Cell (2003)

What would you want the result to be?

5. Re: Adding A Formula From One Cell To Another Cell (2003)

The formula "=Sheet2!B1+Sheet3!C1+Sheet4!B1" in cell A1.

6. Re: Adding A Formula From One Cell To Another Cell (2003)

Why would you want to do that? You can easily add the results of the formulas.

7. Re: Adding A Formula From One Cell To Another Cell (2003)

Thanks, Hans. Yes, I know. However, I wanted a simple method of adding what might very well be very long and complicated formulas/links into one cell directly.
Any ideas?

8. Re: Adding A Formula From One Cell To Another Cell (2003)

For what it's worth, you can use code like this:

Range("A1").Formula = Range("A1").Formula & "+" & Mid(Range("B1").Formula, 2)

<img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•