Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Is this possible?

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).
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Is this possible?

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
--
Gary''s Student - gsnu200832


"Todd Virlee" wrote:

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).

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Is this possible?

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.

"Gary''s Student" wrote:

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
--
Gary''s Student - gsnu200832


"Todd Virlee" wrote:

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).

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Is this possible?

This is do-able, but not easy.
It is beyond this Student's ability.
--
Gary''s Student - gsnu200832


"Todd Virlee" wrote:

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.

"Gary''s Student" wrote:

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
--
Gary''s Student - gsnu200832


"Todd Virlee" wrote:

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).

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"