Dear Friends,
I need a help in my coding to copy the data from text file and paste into an excel file. I try to explain the scenario below.
As I have already tried to importing the csv file in text format into excel and working fine however I am facing issue in some rows which are pasted into another next rows. However when I open csv file in notepad, copy the data and paste it into excel as text then I am getting the perfect data.
I have tried many codes and methods but I could open the csv file in notepad only but could not copy the data. If anyone please help me how to copy the data of opened csv file in notepad and paste it into excel. it will be great help. Below is my code to open csv file in notepad.
I need a help in my coding to copy the data from text file and paste into an excel file. I try to explain the scenario below.
As I have already tried to importing the csv file in text format into excel and working fine however I am facing issue in some rows which are pasted into another next rows. However when I open csv file in notepad, copy the data and paste it into excel as text then I am getting the perfect data.
I have tried many codes and methods but I could open the csv file in notepad only but could not copy the data. If anyone please help me how to copy the data of opened csv file in notepad and paste it into excel. it will be great help. Below is my code to open csv file in notepad.
Code:
Sub MyTextFile()
Dim MyTxtFile
MyTxtFile = Shell("C:\WINDOWS\notepad.exe C:\Users\Gaurangg\Desktop\Dump\21st.csv", 1)
Selection.Copy
End Sub
Last edited: