Let me ask you a question: Let’s say you have 15 excel files (or .csv) in a folder. How do you import them into Minitab?
Are you thinking in these steps?
- Go to File Open Worksheet
- Change the file type to Excel (or .csv or .txt)
- Browse for the file and click Open
- Repeat steps 1 to 3, 14 times! (one for each remaining file)
If you answered YES, you’re wasting your time!!!
There’s a quick and easy way to do this and it takes the same effort regardless of the number of files.
- Open the folder that contains the excel files
- Select the files you want to import ( If you want to select all files, you can press Ctrl + A. )
- Drag the files to the Session Window in Minitab
Pretty impressive, right?
Importing all files in a list with a macro
A more complex scenario is that you have a list of file names that you want to import. In this case again, there are three options
- Completely Manual: Import the files one by one
- Semi-manual: Go to the folder, manually select the files in the list, and drag them to the Session Window in Minitab.
- Automatic: Paste the list in Minitab and use a macro to import them automatically.
I hope that after reading this post you won’t use the completely manual approach anymore.
To solve this problem you can use the semi-manual approach or follow the next steps for a completely automated solution:
1 ) Paste the list of file names in Column C1 of any worksheet.
2 ) Open this macro and modify the appropriate variables
3 ) Save the macro in your Minitab Macro Folder. Make sure the file type is “All Files (*.*)”
(*) Usually the Minitab Macro Folder folder is “C:\Program Files\Minitab\Minitab 16\English\Macros”, however, you can change the path for the macros folder in Tools Options General Browse for the Macro Location OK.
4 ) Press Ctrl + L to show the Command Line Editor, Type %OpenFiles, and press Submit Commands
If you want to practice any of these methods, you can use your own files or you can download the following files:
- Zip Folder with 20 CSV files
- Zip Folder with 20 Excel files
- Excel files with the lists of file names
Enjoy!!!
In the next post, I’ll explain how to append the information of all the worksheets you’ve imported.
Subscribe to the mailing list to get notified when the next post comes out.
Orlando, I like the why you write the macro , do you know how get the p-value for a Run Chart? Don’t use the graph info?
Hi Juan,
Unfortunately, that’s not possible since the Run Chart
graph doesn’t have a storage option. With a storage option you could be
able to save the p-values in a worksheet.
I asked your question
to the Minitab Technical Support team and they answered me that they
logged this request to be considered for future versions.
Hi Juan,
Unfortunately, that’s not possible since the Run Chart graph doesn’t have a storage option. With a storage option you could be able to save the p-values in a worksheet.
I asked your question to the Minitab Technical Support team and they answered me that they logged this request to be considered for future versions.
I saved the macro in the located as indicated above, but when I ran the macro it gave me this error message:
* ERROR * Undefined variable, illegal column or stored constant at X.
* ERROR * Completion of computation impossible.
I am using MINITAB14 importing an .xls file. Would this make a difference?
Hi Charles,
Did you pasted the list of file names in C1 of any worksheet?