Forum Discussion

Excel's avatar
Excel
Iron Contributor
Jul 04, 2022
Solved

Import text file with the help of VBA

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 - 

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..

  • Excel 

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

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

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

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

Resources