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!
Bookmarks