Consulting

Results 1 to 3 of 3

Thread: Add range of rows at the last row

  1. #1
    VBAX Regular
    Joined
    Sep 2008
    Posts
    23
    Location

    Add range of rows at the last row

    Need help to write a macro. I have a file which i need to send out to different users, where they are suppose to input the data and return to me. Some users may need more lines and hence i will need to go into the individual files to add in the rows accordingly.

    Is there any way, where i can write a macro and allow the users to click on the button to add the rows accordingly?

    I have attached the file (Test.xls) to illustrate my problem.
    In my files i have create Item 1 - Item 38 for the users to input their data. But some of the users might require more lines than expected. Hence, i need to input similar rows after Item 38.

    Any idea how can i do that?

    Thanks!

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Sub AddRows()
    Dim LastRow As Long

    With Worksheets("Add Capex")

    LastRow = .Cells(.Rows.Count, "G").End(xlUp).Row

    .Rows(LastRow - 12).Resize(6).Copy
    .Rows(LastRow - 6).Insert Shift:=xlDown
    End With
    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    Sep 2008
    Posts
    23
    Location
    Thanks!!!!!!!! the macro workd perfectly!!

Posting Permissions

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