+ Reply to Thread
Results 1 to 8 of 8

require a macro to insert rows based on a value

  1. #1
    Registered User
    Join Date
    05-13-2013
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2010
    Posts
    4

    require a macro to insert rows based on a value

    Hi, I have a list of data - basically a production plan that I need to insert rows based on a cell value

    I start with a list of orders, each order having a number of required operations. From this, I want to create a new set of data that has the number of rows for each order based on the number of operations per order.
    see the attached file - columns A to C are the original data, columns E to H are what I need to get.

    thanks!
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: require a macro to insert rows based on a value

    Add this for starters to your VBE Sheet1

    Please Login or Register  to view this content.
    Last edited by Excelnoub; 05-31-2013 at 09:20 PM. Reason: Change in code

  3. #3
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: require a macro to insert rows based on a value

    New code above let me know if it works for you


  4. #4
    Registered User
    Join Date
    05-13-2013
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: require a macro to insert rows based on a value

    Hi Excelnoub, thanks for the quick reply. sorry, I'm new to macros...How do i set this up to run this macro manually? thanks

  5. #5
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: require a macro to insert rows based on a value

    I will send you a workbook let me know if this is ok...

    I will also add something to restrict your column C to only numbers.

  6. #6
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: require a macro to insert rows based on a value

    Order.xlsm

    Try this... add a number in Cell C2... Try adding 2 or 3... Then try to add a letter.

  7. #7
    Registered User
    Join Date
    05-13-2013
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: require a macro to insert rows based on a value

    thanks again, look like it functions ok, but I will start with a complete list first (using a lookup on the number of operations), then will need to have the macro run manually and create the expanded range of data either adjacent to the original data range, or preferrably on a new sheet if that's possible...

  8. #8
    Registered User
    Join Date
    05-13-2013
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: require a macro to insert rows based on a value

    Hi Excelnoub, sorry this isn't quite what I'm looking for, I need the new list to be generated on a new sheet, and the macro to be run manually, not as the data is entered. thanks

+ Reply to Thread

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