+ Reply to Thread
Results 1 to 5 of 5

code for insert row counter

  1. #1
    Forum Contributor
    Join Date
    07-08-2015
    Location
    Indiana
    MS-Off Ver
    Excel 2007
    Posts
    128

    Question code for insert row counter

    HI. So now I am looking for the correct code to do the following (I am only using a portion of the code).

    I would like to be able to insert a new row below the already input data. For my code:
    lRow enters the subroutine with a value of 15 { this means the last row of data is on row 15}
    I am looking to insert a row below this one so I can add more data. As the user continues, the counter (lRow) will increase each time this subroutine is called, and continue to insert the next row below the previously used on. {for clearer, I have data in row 15 and 16. The user needs to add more data, so the subroutine will add a new row row 17, and the user can input data. This will continue until the user is done.

    The code I am looking for will be how to call the correct row (last used), add 1 to it, and insert that row.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: code for insert row counter

    How are you identifying the last data row? What is below the range where you want to insert a row?

    Would be easier if you attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: code for insert row counter

    If you simply want to add your data to the first available blank row, you don't have to insert anything. Try:
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  4. #4
    Forum Contributor
    Join Date
    07-08-2015
    Location
    Indiana
    MS-Off Ver
    Excel 2007
    Posts
    128

    {SOLVED} Re: code for insert row counter

    Thanks so much

  5. #5
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: {SOLVED} Re: code for insert row counter

    Glad to help.

+ 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. Adding a counter variable to code
    By nav505 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-14-2013, 08:28 PM
  2. [SOLVED] Looping through a code to get the value of the counter
    By chiidzzz in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 01-29-2013, 02:30 PM
  3. [SOLVED] Dates in Array, Counter (VBA Code Only)
    By lloydgodin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-02-2012, 01:30 PM
  4. Trying to add input box to code and use value in a counter
    By sbernard in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-01-2011, 01:00 PM
  5. counter code?
    By Sharks13 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-30-2007, 07:22 AM
  6. Counter in code
    By Josh_123456 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-28-2006, 04:27 PM
  7. Need to insert a counter for supplies ordering.
    By Phil in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-16-2006, 03:45 PM

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