Results 1 to 4 of 4

VBA Issue: Code only runs halfway than stops.

Threaded View

  1. #1
    Registered User
    Join Date
    02-02-2012
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    42

    VBA Issue: Code only runs halfway than stops.

    Hello,

    So I created a small application here is what it does: (Please dont be scared by the length of this post I am just writing in extreme detail to avoid confusion.) Also note that I commented out and had to remove some sections (You'll get what I mean once you see the workbook) to make the workbook under the 1MB file limit.

    1. User opens form
    2. User checks off all the checkboxes that refer to the drawings they want to add. (Open the form and this will make more sense)
    3. They add the line number for each box and the qty for each box.
    4. The hit add parts
    5. The code in the MatForm runs
    6. It duplicates preset sheets and renames them based on the captions of the checkboxes checked.
    7. Than it adds material qtys to the "CutList" sheet again absed on the checkbox caption of checked off cehck boxes.

    This works perfectly right now. Except for two things:
    1. I get an error message every time it trys copying a sheet that is as follows:
    "The name 'MAT' already exists. Click Yes to use that version of the name , or click No to rename the version of 'MAT' you're moving or copying"

    2. All of the checkboxes from APF512MN to APF524MN only work halfway. They will add the new sheet and rename it but they wont add anything to the"CutList"

    I have been over this code 100 times and maybe Im blind but I cant see where I went wrong. Im sure its a typo somewhere but I cant find it! so if someone can find my mistake it would be awesome!

    Also if you're going through and you think hey he could do this in a much simpler way by all means PLEASE let me know ! Any way I can simplify is apprecated.


    Things you may need to know:

    I'm using excel 2013
    All the global variables are stored in a module called: GlobalVars
    All the code is stored in the code section of "MatForm"

    To Run this as it is supposed to run:
    1.Open the workbook,
    2.Go to the "CutList Sheet"
    3.Click the "CutList Generator" Button (orange button)
    4. Go to the "NAAMS" Tab (ignore the rest they are for other purposes)
    5. Go to the "Fence" Tab than the "MM" Tab
    6. Check off some check boxes and enter random number values in the txtboxes beside them
    7. Click "Add Parts" to see what it does and how it works.

    Heres the workbook.
    NAAMS FENCE JOB MAKER FOR EXCELFORUM.xlsm
    Last edited by TomToms; 10-14-2014 at 08:29 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Sorry if this is a wrong Topic, but can't find the right one... :(
    By david gonzalez in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 12-26-2013, 07:18 AM
  2. Find Products code - what's wrong with it
    By Foreverlearning in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 03-05-2012, 11:09 PM
  3. what's wrong with this find formula
    By tryer in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-22-2010, 04:06 PM
  4. Macro is closing wrong workbook before going to the next workbook
    By curbster in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-12-2009, 05:36 PM
  5. New WorkBook Macro Looking to WRONG WorkBook
    By Corey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-29-2006, 05:40 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