SOLVED

Import text file with the help of VBA

Iron 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 Excel (Iron Contributor)
Solution

@Excel 

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..
1 best response

Accepted Solutions
best response confirmed by Excel (Iron Contributor)
Solution

@Excel 

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

    Application.DisplayAlerts = False
    Worksheets(Worksheets.Count).Delete
    Application.DisplayAlerts = True

View solution in original post