

MyFile = "D:\VPB File\April Files\Final location\Final Input.txt" Here we have named that file as Test with the extension. Step 4: In the assigned variable put the location of the file which we need to convert from Excel to Text. Step 3: In the first step of coding, declare the variable myFile as String as shown below. Step 2: Now, in the opened module, write the subcategory of VBA Write Text or we can choose any name as per our choice. By this, we can save a huge set of data in the text file by reducing and compressing the file size as well. To avoid this, we have a process in VBA, with that, we can convert the excel file into a text file without harming the data. Although it is not a big task to when it is a repetitive activity and may take huge time to perform. For this, we need to convert the excel file into a text file. The text file doesn’t get hanged and we can store as many data and tables into a single text file without crashing the file. Extracting the data from the database is possible if use text file for this purpose. This kind of situation we have seen in many projects where we need to extract the data from the database. Due to this we could neither work on that file nor saving the file into excel format.

We all come across with such kind of situation where we had to put huge data in excel files, but eventually, we have faced the situation when the size of that file with the huge data went so up that we had to convert that into a text file.
