Results 1 to 5 of 5

Insert row macro at the end of a changing data set

Threaded View

jpmorgan123 Insert row macro at the end... 06-03-2013, 09:47 AM
arlu1201 Re: Insert row macro at the... 06-03-2013, 12:24 PM
jpmorgan123 Re: Insert row macro at the... 06-03-2013, 04:29 PM
arlu1201 Re: Insert row macro at the... 06-04-2013, 12:10 PM
jpmorgan123 Re: Insert row macro at the... 06-04-2013, 01:47 PM
  1. #1
    Registered User
    Join Date
    05-10-2013
    Location
    Montreal, CA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Insert row macro at the end of a changing data set

    Hello guys,

    I currently have data inputted into a cell range from B7:I48 and I have a macro that when selected or executed will make a new row on line 49. If this button is selected again, it will add a row on 49 instead of at the end of the new dataset line 50. As the dataset expands down, I would like the macro to insert a row on the line right after the data set. My current code is as follows below. Please advise on how this code should be adjusted. Thank you very much.

    Sub Insert_Row()
    '
    ' Insert_Row Macro
    '
    
    '
        ActiveWindow.SmallScroll Down:=30
        Rows("49:49").Select
        Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
        Range("B48:C48").Select
        Selection.AutoFill Destination:=Range("B48:C49"), Type:=xlFillDefault
        Range("B48:C49").Select
        Range("B49").Select
        ActiveWindow.SmallScroll Down:=-42
    End Sub
    Last edited by arlu1201; 06-03-2013 at 10:55 AM.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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