+ Reply to Thread
Results 1 to 9 of 9

Creating a list with from a flat file DB sheet

  1. #1
    Forum Contributor sorensjp's Avatar
    Join Date
    12-23-2015
    Location
    Yokosuka, JP
    MS-Off Ver
    2007 and 2016
    Posts
    196

    Creating a list with from a flat file DB sheet

    I'm asking assistance to create VBA code to extract a few pieces of data to create a list.

    The attached file includes a Database sheet from which I hope to pull info from and add it to the "Muster Sheet". The rank, full name and DoD ID numbers for only the Active Duty members listed. I've coded the personnel with a legend posted on the user form AN/AF are for Active Duty members. The DoD ID Numbers include the initials so I don't have to create numbers (I'm using the sponsors number).

    I've been searching for some VBA code but cannot find anything close that use (or at least that could understand). I'm still learning VBA and wish I continue. Thank you for your time.

    V/r,
    Jim

    P.S. I must put in a plug for Trevor Easton at onlinepclearning.com his site has helped so much.
    Attached Files Attached Files

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Creating a list with from a flat file DB sheet

    I don't see how active duty is listed. I would probably use an autofilter or advancedfilter.

  3. #3
    Forum Contributor sorensjp's Avatar
    Join Date
    12-23-2015
    Location
    Yokosuka, JP
    MS-Off Ver
    2007 and 2016
    Posts
    196

    Re: Creating a list with from a flat file DB sheet

    I have their ranks listed if not they are dependents. Additionally under the "code" column I use the AN or AF for my active duty personnel. I was hoping to place the info onto the Muster sheet in the order of my mock data listed there as well. I didn't think an advanced filter would do that.

    Jim

  4. #4
    Valued Forum Contributor
    Join Date
    05-08-2015
    Location
    Uvalde, TX
    MS-Off Ver
    2010
    Posts
    720

    Re: Creating a list with from a flat file DB sheet

    Hi Jim,

    I suggest using a Pivot Table to get what you need.

    See attached copy of your file modified.

    There is are two new tabs (because you have the Muster Sheet protected).

    The Pivot table tab is pulling data from the new Sheet 1 which is just a copy of your Database sheet.

    Hope this makes sense and is helpful.

    Cheers
    Attached Files Attached Files

  5. #5
    Forum Contributor sorensjp's Avatar
    Join Date
    12-23-2015
    Location
    Yokosuka, JP
    MS-Off Ver
    2007 and 2016
    Posts
    196

    Re: Creating a list with from a flat file DB sheet

    Southward,

    I think you are right the Pivot Table works, however I hoped I could then "Trim" the text leaving only numbers for the DoD IDs. Is that possible or am I asking too much? Also sorry I forgot to remove the protection the Password is: Online

    Jim

    Thank you again for your direction. I used a very simple formula to give me a finished product.

    V/r,
    Jim
    Last edited by sorensjp; 12-02-2016 at 07:22 PM.

  6. #6
    Valued Forum Contributor
    Join Date
    05-08-2015
    Location
    Uvalde, TX
    MS-Off Ver
    2010
    Posts
    720

    Re: Creating a list with from a flat file DB sheet

    Hi Jim,

    After much trial and error I think I have come up with a simple solution.
    The "Muster Sheet" uses simple formulas to pull data from the "Database" and then filters via the "Code" column. You can hide the column D which is the "Code" that filtered.

    Hope this works for you.

    Cheers
    Attached Files Attached Files

  7. #7
    Valued Forum Contributor
    Join Date
    05-08-2015
    Location
    Uvalde, TX
    MS-Off Ver
    2010
    Posts
    720

    Re: Creating a list with from a flat file DB sheet

    OK, I realized that the previous solution wasn't as good as it needed to be.

    Hopefully, this one is.

    I created three Dynamic Named Ranges so that your Muster Sheet will always include new information entered on the Database.
    The Named Ranges are:
    DatabaseCode : for column T
    DatabaseFullName : for column E
    DatabaseIndex : for columns E to T

    The new formulas for columns A, B and C are:

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    The formulas in columns A and B are array formula's. They need to be entered with a CNTL, SHIFT, ENTER.

    Let me know if you have any issues with it.

    Cheers
    Attached Files Attached Files

  8. #8
    Forum Contributor sorensjp's Avatar
    Join Date
    12-23-2015
    Location
    Yokosuka, JP
    MS-Off Ver
    2007 and 2016
    Posts
    196

    Re: Creating a list with from a flat file DB sheet

    Southward,

    I like your solutions. But I think the Pivot Table solution is best since it is more visual for my users. I've already run with it in it application and distribution. The end users need it as "automated" as possible since most aren't even past very basic Excel users.

    Thank you so much for creating solutions for me. They will be helpful in other projects I have in mind little melon (aka: Brain).

    V/r,
    Jim

  9. #9
    Valued Forum Contributor
    Join Date
    05-08-2015
    Location
    Uvalde, TX
    MS-Off Ver
    2010
    Posts
    720

    Re: Creating a list with from a flat file DB sheet

    Glad I could be of some assistance.

    Cheers

+ 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. Creating Flat Files and Export
    By JPSIMMON in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-20-2015, 07:00 PM
  2. [SOLVED] Sheet Export Macro to Flat File
    By JPSIMMON in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-18-2015, 05:57 PM
  3. [SOLVED] VB to extract comments to new sheet, creating CSV flat file
    By elgato74 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-17-2014, 07:44 PM
  4. Macro to copy a column data to flat file or text file
    By vinaynagasani in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-01-2009, 10:56 AM
  5. [SOLVED] how do I convert an excel file to a flat text file
    By Lannutslp in forum Excel General
    Replies: 1
    Last Post: 06-03-2005, 06:05 AM
  6. Save sheet as fixed length (flat) text file
    By Tim Donovan in forum Excel General
    Replies: 0
    Last Post: 05-24-2005, 03:08 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