+ Reply to Thread
Results 1 to 3 of 3

Insert row based on cell value

  1. #1
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Insert row based on cell value

    Hello Everyone
    I need a VBA code which would insert one new row if a "1" appears in column N of my sheet. So if a 1 appears in Cell N4 then a new row is inserted above it....
    Please Help
    My code is actually going into an infinite loop....
    Regards
    Sourabh

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Insert row based on cell value

    The trick is to work from the bottom of the sheet UP to avoid an infinite loop:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    04-26-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Insert row based on cell value

    This code might help

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. lock and insert formula in a cell based on selection of text in another cell
    By alirazafazal in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-01-2014, 06:08 AM
  2. [SOLVED] Excel Macro, VBA help needed - Insert Cell based on value of a cell in another column
    By alw99 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-03-2014, 05:22 PM
  3. Copy cell data and insert into another worksheet based upon cell
    By cory99 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-22-2013, 08:37 AM
  4. [SOLVED] Event Macro to insert text in cell based on input of another cell
    By nplouffe in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-08-2012, 11:54 AM
  5. After insert new record, insert values in row based on first cell in row
    By frankienap in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2012, 11:36 AM

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