I have a file named "127.txt". My goal is to import this file into an excel worksheet and then rename the excel worksheet to the file name (i.e. worksheet name is 127). I want to import every .txt file in a folder into seperate worksheets of the same workbook and for me to keep track of which .txt file is imported, i want the worksheet name to be the name of the .txt file
My current code is
Sub import_data()
'Access text files
Dim CPath As String 'Current work directory
Dim FPath As String 'Directory for .txt files
CPath = CurDir
FPath = CPath & "\RAW_Data"
'Import text files into seperate sheets
Dim File As String 'File names
File = Dir(FPath & "*.txt") 'returns directory
End Sub
Not sure how to go from here