+ Reply to Thread
Results 1 to 9 of 9

Modify existing VBA coding to expand data retrieval

  1. #1
    Forum Contributor Saeber4777's Avatar
    Join Date
    06-06-2014
    Location
    United States
    MS-Off Ver
    365 Enterprise
    Posts
    159

    Modify existing VBA coding to expand data retrieval

    Sorry for the long winded explanation but to avoid questions later I thought it best to be specific.

    I have uploaded two files - a manifest and a driver log. I transport children to and from the Richardson Center and each driver is required to fill out a driver log to turn in to the state for each day (one in the morning and one in the afternoon). The manifest is given to us by the state with each child to be picked up for that day for 4 separate routes (4 vans).

    Between myself and the generosity of others, I have managed to create an excel program that auto grabs the information out of the manifest file and populates the driver log. The information populated is the name of the child and the child id number which changes each morning and afternoon.

    My company liked the project so much they wanted me to make a version for them to sort out all 4 routes instead of just my own. I am not sure how to modify the VBA code to do this, though I suspect it would be relatively easy for someone more knowledgeable about VBA.

    Once you open the notebook you will see exactly what it is I am trying to do. In column A is the ID number and column B is a list of names that the VBA should look for in the manifest file to store in Columns O:R. Column L sorts the names out and retrieves the ID number to be inserted in column A (due to the names on the manifest not matching the way they should be written out this column is necessary, ex: manifest says: "Smith, Richard, Joh" which on the driver log should be listed as "John R Smith"). I have created 10 tabs for 10 possible routes. Each tab, when refreshed is clicked, just needs to populate the names in the B column with the appropriate codes from the manifest.

    Any help would be greatly appreciated.
    Attached Files Attached Files
    Last edited by Saeber4777; 12-03-2015 at 11:26 AM.

  2. #2
    Forum Contributor Saeber4777's Avatar
    Join Date
    06-06-2014
    Location
    United States
    MS-Off Ver
    365 Enterprise
    Posts
    159

    Re: Modify existing VBA coding to expand data retrieval

    Sorry, the last Daily trip log wasn't the updated file. Here is the updated, please ignore the last one.
    Attached Files Attached Files

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Modify existing VBA coding to expand data retrieval

    Ahh,

    I was just going to ask about that........
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Modify existing VBA coding to expand data retrieval

    OK, Looking at the two files I can't find any of the IDs listed in column A of Route1 in the daily file.

    Furthermore why do all the routes show the same IDs? Have you just copied Route1 an din reality they would all contain different sets of data.

    Can we rewind to the essential task here. It seems to me that you have a daily log of pickups required, all of which need to be allocated to a route, and each route is allocated to a specific driver.

    There are 80 pickups to be allocated to 10 routes which implies an average of 8 IDs for each route. What determines which ID is allocated to which route and how do you ensure that each pickup added after the first can actually be accommodated and the driver has finished the previous pickup? There doesn't seem any logic in your existing macro that would address this particular constraint?

    I think we need to understand precisely how you see this allocation of 80 pickups to 10 driver/routes working.

  5. #5
    Forum Contributor Saeber4777's Avatar
    Join Date
    06-06-2014
    Location
    United States
    MS-Off Ver
    365 Enterprise
    Posts
    159

    Re: Modify existing VBA coding to expand data retrieval

    The Booking ID column on the Manifest (the file name with a date) has the ID numbers.

  6. #6
    Forum Contributor Saeber4777's Avatar
    Join Date
    06-06-2014
    Location
    United States
    MS-Off Ver
    365 Enterprise
    Posts
    159

    Re: Modify existing VBA coding to expand data retrieval

    The Booking ID column on the Manifest (the file name with a date) has the ID numbers. The tabs show the same id because I just copied and pasted the first tab to the other 9. When the names are changed in column B by hand the ID number should refresh automatically when the button is clicked.

    Certain kids will always stay on a certain route/van/driver. They cannot change back and forth. Some drivers may have 8, some 10, some 12 so it cannot be divided like you say. Right now there are only 4 routes. The additional 6 routes (tabs) is for a possible future development.

    In a nutshell, I need the program to look into the manifest, look at the names in column B in the driver log and find those names in the manifest to store in the colored table along with the associated ID numbers. The ID numbers are different for morning for a kid then from the afternoon. Each route on each tab will follow the same protocol when the refresh button is selected for the names on its own sheet column B. Does that make sense? As of right now, the current code is set to look at the date (on cell F3 in the driver log) and look for a filename that is associated with that date (in the format 00-00-00). So each new manifest that comes out daily will be labeled with a date and when the refresh button is selected it will search for the new date, daily.
    Last edited by Saeber4777; 12-03-2015 at 12:57 PM.

  7. #7
    Forum Contributor Saeber4777's Avatar
    Join Date
    06-06-2014
    Location
    United States
    MS-Off Ver
    365 Enterprise
    Posts
    159

    Re: Modify existing VBA coding to expand data retrieval

    BTW, the colored table was only setup because I could not find a way to decipher some of the jarbbled up names on the manifest (thank you arkansas) for the program to recognize using just left,right,mid commands. I had the add the cell code in column L to check for a pattern similar to column b names to retrieve the ID numbers from the table and put them in the right row on column a.

  8. #8
    Forum Contributor Saeber4777's Avatar
    Join Date
    06-06-2014
    Location
    United States
    MS-Off Ver
    365 Enterprise
    Posts
    159

    Re: Modify existing VBA coding to expand data retrieval

    Did I answer your question?

  9. #9
    Forum Contributor Saeber4777's Avatar
    Join Date
    06-06-2014
    Location
    United States
    MS-Off Ver
    365 Enterprise
    Posts
    159

    Re: Modify existing VBA coding to expand data retrieval

    So, were you asking me these questions to leave me hanging or did you really want to try to help 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] Modify existing Code.
    By JO505 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-12-2014, 05:26 PM
  2. [SOLVED] Adding formulas to modify the existing data by vba
    By Rocky2013 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-20-2013, 08:00 PM
  3. help for short existing long coding in VBA
    By santosh226001 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-05-2013, 10:34 AM
  4. Replies: 0
    Last Post: 05-18-2013, 05:42 AM
  5. [SOLVED] Modify vba coding so that the database updates correctly
    By rocksan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-13-2012, 02:31 AM
  6. Modify an existing document
    By Bob Kasper in forum Excel General
    Replies: 3
    Last Post: 05-01-2008, 09:30 AM
  7. Column retrieval as an input to an existing workbook
    By NaomiKay in forum Excel General
    Replies: 8
    Last Post: 03-06-2006, 07:35 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