+ Reply to Thread
Results 1 to 5 of 5

Error - Do Until with iRows and kRows?

  1. #1
    Registered User
    Join Date
    08-01-2018
    Location
    Ann Arbor, MI
    MS-Off Ver
    2016
    Posts
    96

    Error - Do Until with iRows and kRows?

    Hello! I have created a template Order Form that a user is to fill out. When they are done, they click a "Ship" button. That button opens up a workbook with a list of all of the Shipments placed through clicking that button and adds the new parts being ordered to the list. In addition, the Packing List is saved under its own file with a unique ShipNo.

    The problem is that when the parts are being put into the new list, they are repeating over each other instead of adding to the list. So, if the list already has 3 parts in it and I add 3 more, those parts are overwritten by the new ones. My code is listed below. I placed green comments where I have tried different ideas. Sometimes it would add only one part to the list, sometimes it would add none. I need it to add all of them. Any help would be greatly appreciated

    Please Login or Register  to view this content.
    As of right now, is still also overwriting previous rows in the list. I've added an example order form and shipments list as attachments for help. Any ideas?
    Attached Files Attached Files
    Last edited by whahmira; 08-29-2018 at 08:24 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Error - Do Until with iRows and kRows?

    You are hard coding where kRow starts, it may be a good idea to count the rows and find the first empty row.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-01-2018
    Location
    Ann Arbor, MI
    MS-Off Ver
    2016
    Posts
    96

    Re: Error - Do Until with iRows and kRows?

    Will that work even though the shipments list does not start at A1? It starts at A6, and there are empty rows before it

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Error - Do Until with iRows and kRows?

    I should have said it finds the first blank after the last filled cell.

  5. #5
    Registered User
    Join Date
    08-01-2018
    Location
    Ann Arbor, MI
    MS-Off Ver
    2016
    Posts
    96

    Re: Error - Do Until with iRows and kRows?

    Sorry, I just don't understand the VBA coding very well. Thank you, it worked for me!

+ 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. [SOLVED] Odd Error Handling Behaviour; goes to error handler even when no error?
    By kalikj in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-04-2018, 10:04 AM
  2. [SOLVED] Run-tim error -2147467259(80004005): Automation error Unspecidied error
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-25-2014, 12:12 PM
  3. Excel macro (compile error. syntax error.) error
    By salar_younis in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-06-2014, 06:11 AM
  4. Receiving following error “Complie error : syntax error” Help
    By masond3 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-02-2012, 10:19 AM
  5. Error "run-time Error '1004': General Odbc Error
    By D4WNO77 in forum Access Tables & Databases
    Replies: 2
    Last Post: 07-16-2012, 09:55 AM
  6. Error 75 File/Path access error, sometimes Error 1004
    By smokebreak in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-16-2011, 02:35 PM
  7. Error Handling - On Error GoTo doesn't trap error successfully
    By David in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-16-2006, 02:10 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