Dear all,
I've been looking for a VBA code to import data from a txt file and delimit it.
However, I'm blocked when the txt file needs to be selected.
My problem is that the path always change (and the file name as well).
An alternative solution might be to use <code style="margin: 0px; padding: 1px 5px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; background-color: rgb(239, 240, 241); white-space: pre-wrap; color: rgb(36, 39, 41);">Application.GetOpenFilename</code> to choose the relevant file.
However, considering that the macro will copy and past data of other workbooks open according to their name, it would be easier if I can do the same with the txt file.
Therefore my question: is there any way to let Excel import data from an open (unique) txt file without selecting the path?
Thanks a lot for any suggestions you might have.
Regards,
Daniele
I've been looking for a VBA code to import data from a txt file and delimit it.
However, I'm blocked when the txt file needs to be selected.
My problem is that the path always change (and the file name as well).
An alternative solution might be to use <code style="margin: 0px; padding: 1px 5px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; background-color: rgb(239, 240, 241); white-space: pre-wrap; color: rgb(36, 39, 41);">Application.GetOpenFilename</code> to choose the relevant file.
However, considering that the macro will copy and past data of other workbooks open according to their name, it would be easier if I can do the same with the txt file.
Therefore my question: is there any way to let Excel import data from an open (unique) txt file without selecting the path?
Thanks a lot for any suggestions you might have.
Regards,
Daniele