Formula

  • Thread starter Thread starter Ra
  • Start date Start date
R

Ra

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.
 
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
 
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
 
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
 
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
 
right click sheet tab>view code>copy/paste>modify to suit
You will probably want to restrict to a certain range of cells
 
right click sheet tab>view code>copy/paste>modify to suit
You will probably want to restrict to a certain range of cells
 
Back
Top