+ Reply to Thread
Results 1 to 2 of 2

Using a cell as a search box to find and then import data

  1. #1
    Registered User
    Join Date
    11-07-2016
    Location
    UK
    MS-Off Ver
    2010
    Posts
    5

    Using a cell as a search box to find and then import data

    Hi,

    Apologies for the long post!

    I have a number of parts that need the raw inspection data sorting and graphs creating. To do this manually would take stupidly long so I wrote a macro.

    I now want the macro available to be used by others. However, the raw data is in a text format so needs to be imported as text and delimited into columns. The data sorting macro also requires the data to be imported in to cell A1 to work properly.

    To minimise any issues that could go wrong with them importing the data in the wrong format or in the wrong cell I want to create a method for them so search for files they need and for a macro to import the data automatically in the correct format.

    So step by step what I need is as follows:

    - Have two separate cells to act a search boxes. The first cell e.g. D1 will filter for part version (either ‘A’ or ‘B’). - The second cell e.g. E1 the user will enter a part number as text, for example “P123”.
    - The user can then hit a button to run a macro.
    - The macro will use “External Data from text” function to insert the data.
    - The macro will have to search through a specific directory in a shared folder to find a folder name that matches the part name entered in E1.

    Example folder name: P123

    -Within that matching folder will be a series of files. The macro will open the file that contains the correct part version designated in cell D1 e.g. A or B. Within the folder will be two files, one that ends in an ‘i’ for input and one the ends in an ‘o’ for output. In this problem I only want to open the files that end in ‘i’.

    Example file name: A_P123_1122_i.dat

    'A' is the part version _ P no. is part no. _ 1122 is measurement no. _ 'i' is for data input.

    - In the Text Import Wizard..
    o Step 1: Select ‘Delimited’
    o Step 2: In Delimiters menu, Tab and Space need to be ticked.
    o Step 3: Finish
    o Then import data into Cell A1.

    Many thanks to anyone who can help. I'm new to programming and so far I've managed by recording macro's and googling but I came a bit stuck with this problem. I'm sure it's possible just not sure how!

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Using a cell as a search box to find and then import data

    A small file is worth 1000 words.

    Will you please attach a sample Excel workbook? Please don't attach a picture of one.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

+ 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. Search Table to find exact matchs, then pull data from corresponding cell
    By Lubby in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-21-2016, 08:36 PM
  2. Code to automatically search a site to import data
    By Tonan230 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-20-2016, 07:57 PM
  3. search and import data
    By Gaurav_92 in forum Excel General
    Replies: 6
    Last Post: 05-29-2014, 02:21 AM
  4. Match data and find data following search several search criterias
    By maxtymo in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-05-2013, 08:18 PM
  5. Find & Import Data from text fil
    By rajeev.raj in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-22-2013, 07:23 AM
  6. Macro to Search Cell on Sheet1, find on Sheet3, paste other data
    By Lennie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-13-2011, 01:11 PM
  7. Find and Import data from Access
    By FN2010 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-25-2010, 07:31 PM

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