Results 1 to 5 of 5

Development of a macros that inserts a row into sheet 1 to insert in sheet 2

Threaded View

jj123 Development of a macros that... 02-15-2013, 12:50 PM
Turtleman10 Re: Development of a macros... 02-15-2013, 01:15 PM
jj123 Re: Development of a macros... 02-15-2013, 05:20 PM
Turtleman10 Re: Development of a macros... 02-15-2013, 05:32 PM
jj123 Re: Development of a macros... 02-18-2013, 05:24 AM
  1. #1
    Registered User
    Join Date
    01-09-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    5

    Development of a macros that inserts a row into sheet 1 to insert in sheet 2

    Hi,

    I have a question revolving around an "insert a row" and "copy the formula" macros - I'm not that familiar with coding in excel but found the following script online - which works really well in the attached example:

    Sub InsertRow()
    Dim Rng, n As Long, k As Long
    Application.ScreenUpdating = False
    Rng = InputBox("Enter number of rows required.")
    If Rng = "" Then Exit Sub
    Range(ActiveCell, ActiveCell.Offset(Val(Rng) - 1, 0)).EntireRow.Insert
    'need To know how many formulas To copy down.
    'Assumesfrom A over To last entry In row.
    k = ActiveCell.Offset(-1, 0).Row
    n = Cells(k, 256).End(xlToLeft).Column
    Range(Cells(k, 1), Cells(k + Val(Rng), n)).FillDown
    End Sub

    All I need is a few tweaks - which I have no idea how to do....

    I would like it not to copy the data in column B and I would like it to insert exactly the same amount of rows and the relevant formula in the same place in Sheet "B".

    Any help would be much appreciated!

    THANK YOU
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1