+ Reply to Thread
Results 1 to 5 of 5

Error Checking Code

  1. #1
    Registered User
    Join Date
    12-13-2007
    Posts
    3

    Error Checking Code

    So Ive got some experience in programming, just not with Excel & VBA and Im trying to do a bit of error checking on a quote form in Excel. I'll give you the code first:

    Please Login or Register  to view this content.

    Basically I have a column that has acceptable sizes and gauges of film. The for loop is supposed to run through the size column and if it matches up with an acceptable size it will then continue to the nested for loop to check gauge. If the gauge matches it should dump out of both loops but if it doesnt, it has to check one last cell (material weight) and if it is less than 500 pounds it should popup an error msg, otherwise, dump out of the loop(s).
    Im getting a 400 error when I test it and Im clueless as to what is going on.

    Thanks for the help

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello kylegwell,

    Welcome to the forum! There are few things I want to ask you about in your code.

    There are a couple of problems with the loop. Did you want to count down by 1?
    Please Login or Register  to view this content.
    If so, the code should be written...
    Please Login or Register  to view this content.
    If your variable Row is referring to a row then you need to switch places with the variable C in this statement. The cells syntax is Cells(row number, column number)
    Please Login or Register  to view this content.
    Change the rest of the Cells statements and rerun your code. Let me know if you have any more problems.

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    12-13-2007
    Posts
    3
    Thanks for those syntax changes. I corrected them and Im still getting that 400 error. Here is the updated code
    Please Login or Register  to view this content.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello kylegwell,

    If I understand your code correctly, your are using the Column letter in the Cells statement. When using the column letter, enclose it in quotes...
    Please Login or Register  to view this content.
    I didn't catch that the first time because I thought you had declared some variables as letters. I made the changes in the code below..
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  5. #5
    Registered User
    Join Date
    12-13-2007
    Posts
    3
    Thanks Leith. Code looks good and sort of works. It isn't popping up the msg box when it needs to but I should be able to figure that part out. If I need more help I will pop in again.

    Thanks again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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