auto insert

G

Guest

hiya,,, i have the following line of code ...

Sub insertrow()
Dim sheet As Worksheet
Application.ScreenUpdating = False

Row = InputBox("Please Enter The Line Number Where You Want To Enter New
line")

For Each sheet In Worksheets(Array("Jan", "Feb", "March", "april", "may",
"June", "July", "Aug", "Sep", "Oct", "Nov", "Dec", "Overview"))
sheet.Rows(Row).Insert

Next sheet

End Sub

..... i am trying to get each page to either auto insert a formula into cells
b , c . d . e of which ever row number is selected or copy and paste the
formulas from the same 4 cells in the live above (which are already in place)
any ideas how to do either
 
B

Bob Phillips

Here is an example

Worksheets(Array("Jan", "Feb", "March", "April", _
"May", "June", "July", "Aug", _
"Sep", "Oct", "Nov", "Dec", "Overview")).Select
Sheets("Jan").Activate
Rows(10).Insert
Range("B10").FormulaR1C1 = "=R[-9]C[-1]"
Range("C10").FormulaR1C1 = "=R[-9]C[-1]+1"
Range("D10").FormulaR1C1 = "=R[89]C[-1]*2"
Range("E10").FormulaR1C1 = "=SUM(RC[-3]:RC[-1])"


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
G

Guest

ta very much

Bob Phillips said:
Here is an example

Worksheets(Array("Jan", "Feb", "March", "April", _
"May", "June", "July", "Aug", _
"Sep", "Oct", "Nov", "Dec", "Overview")).Select
Sheets("Jan").Activate
Rows(10).Insert
Range("B10").FormulaR1C1 = "=R[-9]C[-1]"
Range("C10").FormulaR1C1 = "=R[-9]C[-1]+1"
Range("D10").FormulaR1C1 = "=R[89]C[-1]*2"
Range("E10").FormulaR1C1 = "=SUM(RC[-3]:RC[-1])"


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

ME @ Home said:
hiya,,, i have the following line of code ...

Sub insertrow()
Dim sheet As Worksheet
Application.ScreenUpdating = False

Row = InputBox("Please Enter The Line Number Where You Want To Enter New
line")

For Each sheet In Worksheets(Array("Jan", "Feb", "March", "april", "may",
"June", "July", "Aug", "Sep", "Oct", "Nov", "Dec", "Overview"))
sheet.Rows(Row).Insert

Next sheet

End Sub

.... i am trying to get each page to either auto insert a formula into cells
b , c . d . e of which ever row number is selected or copy and paste the
formulas from the same 4 cells in the live above (which are already in place)
any ideas how to do either
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top