+ Reply to Thread
Results 1 to 3 of 3

Macro for inserting rows w/ data works fine for 4iterations, but skips updates in 5th

Hybrid View

  1. #1
    Registered User
    Join Date
    02-14-2015
    Location
    India
    MS-Off Ver
    2010
    Posts
    2

    Macro for inserting rows w/ data works fine for 4iterations, but skips updates in 5th

    Hi,

    I have a sheet with 4 line items with various values. For ex.

    A B
    Apples 4
    Apples 6
    Orange 8
    Berry 9
    Cherry 2
    Cherry 6

    I had to come up with a macro that gets the last occurrence of each of these items and go to the row next to the last occurrence; insert a new row, and update the values from the rows above. My macro runs fine for 4 continuous iterations. But, in the 5th iteration, the last line item is not taken into the calculations.

    Any help on how this can be resolved and to find the cause of it is greatly appreciated.

    Many Thanks!

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,414

    Re: Macro for inserting rows w/ data works fine for 4iterations, but skips updates in 5th

    What your code?
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  3. #3
    Registered User
    Join Date
    02-14-2015
    Location
    India
    MS-Off Ver
    2010
    Posts
    2

    Re: Macro for inserting rows w/ data works fine for 4iterations, but skips updates in 5th

    Here it is...attaching the workbook!!

    Thanks in advance!
    Attached Files Attached Files

+ 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. Vlookup works fine, but not in Macro
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-01-2010, 12:54 PM
  2. Macro works fine... until I save it
    By hoffey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-23-2009, 04:34 PM
  3. macro works fine once than scrambles everything the second time
    By drocket in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-30-2007, 04:49 PM
  4. Macro hangs up often but sometimes works fine
    By Jeff in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-13-2006, 08:10 AM
  5. Macro works fine on PC; fails on Mac
    By marlea in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-20-2006, 04:35 PM

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