Hello,
I have the following workbook with a vba code that will combine files on an individual tab in an excel workbook.
Is it possible to have this recognize .csv files? and possibly even .ods as well?
Thank you!
Patrick
Hello,
I have the following workbook with a vba code that will combine files on an individual tab in an excel workbook.
Is it possible to have this recognize .csv files? and possibly even .ods as well?
Thank you!
Patrick
Last edited by PC41; 09-17-2021 at 04:19 PM.
Look at the Power Query Option.
https://www.youtube.com/watch?v=K-nal4mlVq8
Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").
It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.
- Follow this link to learn how to install Power Query in Excel 2010 / 2013.
- Follow this link for an introduction to Power Query functionality.
Alan עַם יִשְׂרָאֵל חַי
Change an Ugly Report with Power Query
Database Normalization
Complete Guide to Power Query
Man's Mind Stretched to New Dimensions Never Returns to Its Original Form
Thank you Alan,
In the example given in the youtube video I believe the files have only one tab that are all formatted the same. In the files we receive from there are multiple tabs.
How would I choose to extract just the tab titled report from each file? Usually we combine them all with original attached macro, delete the extra tabs then, run a separate macro to combine all the sheets.
Also, it does not seem to work for .ods (open office) file types. I have attached a few example files where I would only combine the report tab.
A bit confused here. You indicated in your original post that the files were CSV which means there should not be any tabs. Please clarify. As to the ODS files, they would need to be converted to xlsx first. There is not currently available the abiltiy to bring ODS directly into the PQ Editor. Once you clarify the CSV issue/question, I will address the Tab issue..
Sorry Alan,
I should have been more clear. I was wondering if the VBA code in the original post could be tweaked to also show .csv & .ods files in the selection menu. It currently will only allow selection of xlsx, xls & xlsm. I have pasted the code below. Also, thank you for showing me the power query function. I look forward to researching this more and I believe this will help with a separate task that I currently do related only to csv.
Code:
Please Login or Register to view this content.
Last edited by PC41; 09-21-2021 at 09:41 AM.
Administrative Note:
Welcome to the forum.
We would very much like to help you with your query, however you need to include code tags around your code.
Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.
Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
(Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
I have updated VBA code w/ proper formatting
This would provide you with the three file type options in the drop down:
Please Login or Register to view this content.
Rory
Thank you @rorya, but it still doesnt seem to be allowing me to select ods and csv in the menu when I run the macro. Please see macro menu prompt vs the actual file location below.
File explorer folder w/ .ods, .csv, xlsx files:
Attachment 748142
Macro file choice menu:
Attachment 748143
Last edited by PC41; 09-17-2021 at 05:52 PM.
Your attachment doesn't work. The dropdown in the file picker should have three different options in it.
@rorya I tried opening the attachment from the original post, ran the macro and it worked. It opens file explore menu and then lets you select individual files and combines all tabs from selected files into a single workbook. It just wont recognize ods or csv even though they are in the location. I think in the code I pasted may not have had the code tags around everything.
Please Login or Register to view this content.
It sounds like you want all options available at once rather than being able to switch between the three, in which case what you need is just something like:
Please Login or Register to view this content.
It is working. Thank you so much!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks