I have the following Macros to select multiple files and import them into workbooks.
Once the data is imported I then label the tab based on part of the filename and then run multiple processes to cleanup the data then save each file with a filename based on date and time. I've removed those lines as they are't relevant to the part I'm struggling with.
I left in the Lattitude and Longitude calculations to show the way I search the top row for the header I want and then use that as a reference for the following calculations.
If there is a more elegant way to find the column I want and process the calculation based on that I'd be happy to hear it. The way I've done it seems a bit messy, but I can't think of a better way.
I've attached a workbook with 2 tabs. One with 10 lines as a table, the other as a normal data import.
What I'd really like to do is import the data as a query. That way I can use references such as @[Lon_2M] and @[Lon_2L] which makes it much easier to work with. However I have no idea how to incorporate a Table Query import into the macro I have.
I recorded the query import process which is below, but as you can see it hardcodes the filename into the macro instead of my `fname` variable used in the first one.
Bookmarks