Syntax Modification Help

  • Thread starter Thread starter DMM
  • Start date Start date
D

DMM

Hi,

I have a macro that I want to place in the sheet so
instead of pressing a button, the user can click the next
cell and the macro will perform. So I am going to place
the code below into the worksheet. I need to understand
how to modify it so that whenever the user clicks the next
cell lets say cell I2, this macro is performed...

Sub insertrowswithformulas()
With ActiveCell
..EntireRow.Insert
Range(Cells(.Row - 2, "I"), Cells(.Row - 2, "AK")).Copy _
Cells(.Row - 1, "I")
Range(Cells(.Row - 2, "B"), Cells(.Row - 2, "G")).Copy _
Cells(.Row - 1, "B")
End With
End Sub


Thanx
 
You could probably do this with a selectionchange event. Right click sheet
tab>view code>left window>worksheet>right selection change. Dangerous. I
would stick with the button/shape.
 
Back
Top