SOLVED

Import text file with the help of VBA

Super Contributor

Hello Everyone, 

 

I have tried VBA code and its work. But If our original Workbook has No data in sheet 1,  It Starts adding other sheets. It's not Started filling with sheet one.

like - 

Annotation 2022-07-04 144740.png

I want to start the code with the first sheet and for other data it also add a new one. 

So, what should i write in VBA code?

 

Please help..

 

Here is a attached file..

2 Replies
best response confirmed by Zain123 (Super Contributor)
Solution

@Zain123 

I'd delete the empty sheet at the end of the code:

    Application.DisplayAlerts = False
    Worksheets(Worksheets.Count).Delete
    Application.DisplayAlerts = True
Thank you so much sir..