Hi,
I found this code that import TAB delimited text file. I would like to import space delimited text file instead. Please help me modify it.
Thanks for your help.
Please Login or Register to view this content.
Hi,
I found this code that import TAB delimited text file. I would like to import space delimited text file instead. Please help me modify it.
Thanks for your help.
Please Login or Register to view this content.
Last edited by FDibbins; 01-15-2014 at 09:12 PM.
welcome to the forums,
you should look at the forum rules about posting code before one of the moderators gets on your case
If you look at the vba help for the split function you will see that the default delimiter is a space, so it looks like you only need to change the code to say
I havent tried the code you supplied but it seems you agree it works for tab delimited filesPlease Login or Register to view this content.
Hope this helps and again, welcome to a forum where I am constantly amazed by how clever some solutions are and how much knowledge forum members are prepared to share
Jmac
Hi,
After change to
I got "subscript out of range" error and it highlights this linePlease Login or Register to view this content.
Thanks for your help.Please Login or Register to view this content.
Last edited by FDibbins; 01-15-2014 at 09:12 PM.
Hi and welcome to the forum
jmac did try to advise you...
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.
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, it also maintains VBA formatting.
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
I will add them for you - this time
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
huytran102,
can you please send me a sample spreadsheet tht you are working with as well as an example of the space delimited file.
I only need a couple of rows in the input data file to run the code through
To attach files, click on the "Go Advanced" button, select add files and you should be OK from there
jmac
Thanks for all the help so far. Attached is the space delimited text file I'm trying to import.
Might suggest the OP reads about the cross posting rule as well: http://www.ozgrid.com/forum/showthread.php?t=185387
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks