Is this possible?

  • Thread starter Thread starter Todd Virlee
  • Start date Start date
T

Todd Virlee

If your spreadsheet looks like this

ValueA ValueB ValueC

where these cells are A1, A2, and A3.

If another row has a cell that has =(A1+A2), we want to have a macro that
would put a value in the cell below that displays =(ValueA+ValueB).
 
Select the cell containing the formula and run:

Sub document_it()
Set r = ActiveCell
v = r.Formula
v = Replace(v, "A1", Range("A1").Value)
v = Replace(v, "B1", Range("B1").Value)
r.Offset(1, 0).NumberFormat = "@"
r.Offset(1, 0).Value = v
End Sub
 
Now we need to figure out how to make it dynamic so it will be able to work
with any cell references in the sheet.
 
This is do-able, but not easy.
It is beyond this Student's ability.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top