Dear Praveen, I suggest you record a macro with using relative references.
Steps are as follows( key Steps)
1. Open a macroenabled workbook.
2. Start recording
3. goto data tab and import the txt file you want to import.
4. Use Text to col. whizard to convert
5. SAve and exit macro.
Try this and you will have your working code ready. We can review the code to eliminate those extra steps which excel normally records.
Bookmarks