+ Reply to Thread
Results 1 to 6 of 6

Insert multiple rows depending on cell value

  1. #1
    Registered User
    Join Date
    04-16-2012
    Location
    Space
    MS-Off Ver
    Excel 2010
    Posts
    14

    Insert multiple rows depending on cell value

    Hi all,
    I'm trying to insert multiple rows in a spreadsheet. The number of rows inserted is based on the cell value - 1.
    I'm able to change the number of rows inserted, but the number if fixed. I want the number to change depending on the value in column B.

    Thanks,

    Please Login or Register  to view this content.
    Column A Column B
    Name Value
    456 1
    1
    454 1
    Select 3
    158 1
    Select 1
    865 1
    546 2
    948 3
    Select 4
    556 1
    642 2
    Select 3
    545 1
    Last edited by AR-51; 03-03-2013 at 04:06 AM.

  2. #2
    Registered User
    Join Date
    04-16-2012
    Location
    Space
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Insert multiple rows depending on cell value

    I'm one step closer.
    I can get it to insert the number of rows based on the value in the cell.
    The next step is to get it to (- 1) from the cell value.

    I changed:
    Please Login or Register  to view this content.
    to:
    Please Login or Register  to view this content.
    Last edited by AR-51; 03-03-2013 at 04:13 AM.

  3. #3
    Registered User
    Join Date
    04-16-2012
    Location
    Space
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Insert multiple rows depending on cell value

    I might need to add:
    Please Login or Register  to view this content.
    but, I'm don't know how.
    Last edited by AR-51; 03-03-2013 at 04:13 AM.

  4. #4
    Registered User
    Join Date
    04-16-2012
    Location
    Space
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Insert multiple rows depending on cell value

    + 1 works, but -1 does not. I'm guessing VBA cannot add 0 row.

    Please Login or Register  to view this content.
    I might need to change the If statement to skip values with 1.
    Last edited by AR-51; 03-03-2013 at 04:13 AM.

  5. #5
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Insert multiple rows depending on cell value

    Hi -

    Please use code tags in all your post.

    Please Login or Register  to view this content.
    event

  6. #6
    Registered User
    Join Date
    04-16-2012
    Location
    Space
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Insert multiple rows depending on cell value

    Thank you very much event21.
    I was able to solve it, but your code looks way better than mine.

    My next step is to fill in the empty cells.

    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