+ Reply to Thread
Results 1 to 2 of 2

VBA: use external file as DB and combobox for drop down list selection: confused and lost

  1. #1
    Forum Contributor
    Join Date
    07-08-2015
    Location
    Indiana
    MS-Off Ver
    Excel 2007
    Posts
    128

    VBA: use external file as DB and combobox for drop down list selection: confused and lost

    Hi all

    I have had several people offer help for my delima, and I am now having issues. I have probably mixed and confused the assistance from others to the point where when I attempt to run my code, I am somewhere lost in an infinite loop and I can not even get my userform to come up. I have attempted to debug and step through to no avail, still, can not determine where my issue is.

    SO, I am posting my entire code here, with an explanation of what I am attempting to do in hopes that someone smarter than I am with VBA is willing to assist me in getting past this point. I feel that my code is close to finished for what I have been asked to do by my boss.

    What my program is supposed to do:

    It opens a page for a receiving report. The code should get the data for the combobox dropdown list of the part number (Partno and then description) from a file off what we call our G: drive. This file has 2 columns, column A is the part numbers and column B is the description. This has to be used as we are continually updating with new parts and /or revised part numbers from our customers.

    The user then selects the part number from the dropdown selection, and its corresponding description comes up in the combobox. I am needing to keep the part number in a variable called Partno and the description in a variable called Description for use later in the program. My main issue was getting both of these into their respective variables for use later.

    What is happening:

    NOW--- I am in this loop where I click on the Receive Product button and there is an infinite loop. Prior to this happening, the userfomr would load and the dropdown list would be populated. Then my next issue is

    I keep getting an error in the procedure called sub cbPartno_change
    specifically on the code with cbPartno
    Partno = .List(.ListIndex, 0) I either get subscript error or list not found.


    I appreciate anyone who can assist me on this.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,937

    Re: VBA: use external file as DB and combobox for drop down list selection: confused and l

    In your sub

    Private Sub getpalletcount()

    In your While loop, you forgot to use Set to increment to the next cell, so it keeps looking at one cell over and over and over.....

    So, change

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

+ 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] Userform: Change Combobox list based on a second ComboBox selection
    By Groovicles in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-11-2016, 03:45 PM
  2. [SOLVED] Change next ComboBox list based on previous ComboBox selection
    By SteveTheFish in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-26-2015, 11:23 PM
  3. [SOLVED] Make combobox list options dependant on selection in another combobox within a userform
    By Vladimir_Dobvchenko in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-23-2013, 05:30 AM
  4. Drop down list (Combobox) with dynamic selection (VBA code)
    By zeez36 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-27-2013, 04:03 AM
  5. Populate Drop-down list based on selection from previous drop-down list
    By Diventus in forum Excel - New Users/Basics
    Replies: 14
    Last Post: 01-11-2013, 10:55 AM
  6. Populate Drop-down list based on selection from previous drop-down list
    By poison_stone in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 12-11-2012, 06:10 PM
  7. Lost my file but not really! Confused.
    By steven314 in forum Excel General
    Replies: 0
    Last Post: 07-03-2007, 06:22 PM

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