+ Reply to Thread
Results 1 to 3 of 3

Looping Solver in VBA

  1. #1
    Registered User
    Join Date
    09-29-2014
    Location
    Texas
    MS-Off Ver
    2013
    Posts
    2

    Looping Solver in VBA

    I'm trying to create a basic 1D cutting optimizer using Solver in VBA. However, I keep getting hung up when I try to implement Solver in a loop. I've allowed myself a few criteria to follow by, which I believe I have achieved in my code so far. Any help at all would be greatly appreciated!

    Goal: Minimize the amount of stock pipe used
    By Changing: Changing the amount of predetermined lengths of pipe to be cut per stock piece
    Constraint 1: Each Cut length cannot exceed the maximum length of stock pipe (21')
    Constraint 2: All pipes spooled must be used in the optimization template
    Constraint 3: All values of pipe must be rounded to the nearest whole number
    Constraint 4: If the the amount of pipes exceed the capacity of the stock pipe, additional stock must be added to the order

    Currently I have 2 command buttons to complete my task, but eventually I would like to make it run with just one. I'm not super good with programming and some concepts, but have taken a couple of classes and done independent research to get myself along. Thank you for your help!

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    09-29-2014
    Location
    Texas
    MS-Off Ver
    2013
    Posts
    2

    Re: Looping Solver in VBA

    Instead of looping, I think i might try creating a range of cells that I can have solver find and fill within VBA. Here is my code so far, but when I run it I get,"Error in model. Please verify that all cells and constraints are valid."
    Not sure where my mistake is :/

    Please Login or Register  to view this content.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Looping Solver in VBA

    Welcome to the forum.

    Please take a few minutes to read the forum rules about cross-posting.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

+ 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. Solver Looping
    By Weston12 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-10-2014, 07:31 PM
  2. Solver in looping cannot work?
    By alee001 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-24-2012, 03:15 PM
  3. looping of Solver in VBA
    By bored in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-14-2010, 11:28 AM
  4. Looping and Solver
    By junejaja in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-28-2008, 11:53 AM
  5. Looping a Solver
    By Peter1999 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-31-2007, 08:32 AM

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