+ Reply to Thread
Results 1 to 7 of 7

Macro keeps stopping in the same place when run all at once, but runs line-by-line

Hybrid View

  1. #1
    Registered User
    Join Date
    07-18-2014
    Location
    Oxnard, CA, USA
    MS-Off Ver
    2010
    Posts
    4

    Re: Macro keeps stopping in the same place when run all at once, but runs line-by-line

    What the loop is doing with the 'problem' cells.find statement above is to go to sheets whose names are listed as Cases, e.g. Line A, Line B, Line C, etc.

    Whenever it goes to one of these worksheets (for example Line B), it determines what the last row in the A column is, then makes a string of the address of A2 to G(lastrow).

    It then goes to the WSName worksheet, the main worksheet where the form is being created, and determines what row the next section starts in order to insert a number of rows right above it, pushing the next section down, that will fit the future copy range.

    It then inserts the new sub-section name (Line B Equipment), copies the range from the Line B sheet, and pastes it in the WSName worksheet in the range it created by inserting rows.


    It then goes to the next case "Line C", and starts over again

  2. #2
    Registered User
    Join Date
    07-18-2014
    Location
    Oxnard, CA, USA
    MS-Off Ver
    2010
    Posts
    4

    Re: Macro keeps stopping in the same place when run all at once, but runs line-by-line

    With this loop, somehow and SOMETIMES the cells.find statement (the one that is finding the Title of the next section) is making the macro enter debugging mode when the whole macro is run at once. Other times it works perfectly. The cell it's trying to find is always there (the title's name / cell.value never changes), so I'm not sure where exactly the error is coming from, especially since it's not happening all the time.

+ 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. Replies: 4
    Last Post: 06-25-2014, 03:22 PM
  2. Macro runs line by line but not as one?
    By timwilks13 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-10-2014, 09:01 AM
  3. Altering this macro: Insert copy of line in same place on 2 sheets!
    By gangel in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-16-2012, 04:10 AM
  4. Macro to move cells (Col B to Col V) to other sheet. Place line number in col A
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-29-2011, 03:43 PM
  5. Macro problem on, Yellowed line - previous line or next line.
    By Ed in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-29-2005, 07:06 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