Is it possible to write Excel formulas and reference the active cell as part
of the formula.
Use:
As you scroll you data, a cell at the top of the spreadsheet would show the
results of a formula that was being calculated based on where the cursor was
(active cell).You can use VBA for that, with the Workbook event SelectionChange, for example:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveSheet.Range(quot;B2quot;).Formula = quot;=quot; amp; Target.Address
End Sub
This will change the formula in B2 to show the value of the selected cell,
you can make it more complex and add error checking (to avoid circular
references, for example)
Hope this helps,
Miguel.
quot;EPMMGR06quot; wrote:
gt; Is it possible to write Excel formulas and reference the active cell as part
gt; of the formula.
gt; Use:
gt; As you scroll you data, a cell at the top of the spreadsheet would show the
gt; results of a formula that was being calculated based on where the cursor was
gt; (active cell).
gt;
With Change-event code.........this will multiply the value in Cell B1 times
the value in the Active-cell
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Range(quot;a1quot;).Value = Range(quot;b1quot;).Value * Target.Value
End Sub
Vaya con Dios,
Chuck, CABGx3
quot;EPMMGR06quot; wrote:
gt; Is it possible to write Excel formulas and reference the active cell as part
gt; of the formula.
gt; Use:
gt; As you scroll you data, a cell at the top of the spreadsheet would show the
gt; results of a formula that was being calculated based on where the cursor was
gt; (active cell).
gt;
- Mar 09 Fri 2007 20:36
how to use the active cell in an Excel formula
close
全站熱搜
留言列表
發表留言