ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Formula (https://www.excelbanter.com/excel-discussion-misc-queries/231283-formula.html)

RA

Formula
 
I have a spreadsheet in which I have formulae in some cells in one single
row. I want to apply those formulae to all the subsequent rows in the
worsheet, so that when I type a number in the cell it will automatically give
me the result. In addition, I want to be able to hide those formulae.

Please can you help.







Don Guillett

Formula
 
You can do this with a worksheet_change event macro in your sheet module.
Here's one I did a few days ago.

Private Sub Worksheet_Change(ByVal Target As Range)
mv = Target
Application.EnableEvents = False
Target.Formula = "=offset(a1," & mv & ",2)"
Application.EnableEvents = True
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Ra" wrote in message
...
I have a spreadsheet in which I have formulae in some cells in one single
row. I want to apply those formulae to all the subsequent rows in the
worsheet, so that when I type a number in the cell it will automatically
give
me the result. In addition, I want to be able to hide those formulae.

Please can you help.








RA

Formula
 
Hi Don

Many thanks for your help. I am a new user to Excel and am not sure how to
install the macro. Please could you help me.

Many thanks

"Don Guillett" wrote:

You can do this with a worksheet_change event macro in your sheet module.
Here's one I did a few days ago.

Private Sub Worksheet_Change(ByVal Target As Range)
mv = Target
Application.EnableEvents = False
Target.Formula = "=offset(a1," & mv & ",2)"
Application.EnableEvents = True
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Ra" wrote in message
...
I have a spreadsheet in which I have formulae in some cells in one single
row. I want to apply those formulae to all the subsequent rows in the
worsheet, so that when I type a number in the cell it will automatically
give
me the result. In addition, I want to be able to hide those formulae.

Please can you help.









Don Guillett

Formula
 
right click sheet tabview codecopy/pastemodify to suit
You will probably want to restrict to a certain range of cells

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Ra" wrote in message
...
Hi Don

Many thanks for your help. I am a new user to Excel and am not sure how
to
install the macro. Please could you help me.

Many thanks

"Don Guillett" wrote:

You can do this with a worksheet_change event macro in your sheet module.
Here's one I did a few days ago.

Private Sub Worksheet_Change(ByVal Target As Range)
mv = Target
Application.EnableEvents = False
Target.Formula = "=offset(a1," & mv & ",2)"
Application.EnableEvents = True
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Ra" wrote in message
...
I have a spreadsheet in which I have formulae in some cells in one
single
row. I want to apply those formulae to all the subsequent rows in the
worsheet, so that when I type a number in the cell it will
automatically
give
me the result. In addition, I want to be able to hide those formulae.

Please can you help.










RA

Formula121
 
Hi Don

Please can you explain to me how the above macro works?

Thank you,

"Don Guillett" wrote:

right click sheet tabview codecopy/pastemodify to suit
You will probably want to restrict to a certain range of cells

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Ra" wrote in message
...
Hi Don

Many thanks for your help. I am a new user to Excel and am not sure how
to
install the macro. Please could you help me.

Many thanks

"Don Guillett" wrote:

You can do this with a worksheet_change event macro in your sheet module.
Here's one I did a few days ago.

Private Sub Worksheet_Change(ByVal Target As Range)
mv = Target
Application.EnableEvents = False
Target.Formula = "=offset(a1," & mv & ",2)"
Application.EnableEvents = True
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Ra" wrote in message
...
I have a spreadsheet in which I have formulae in some cells in one
single
row. I want to apply those formulae to all the subsequent rows in the
worsheet, so that when I type a number in the cell it will
automatically
give
me the result. In addition, I want to be able to hide those formulae.

Please can you help.












All times are GMT +1. The time now is 02:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com