axebrock
06-03-2017, 01:42 AM
Hi all
I have been trying to build a macro to copy three parameters/data from notepad and copy it to excel. It seems easy but i didn't know how can i start with it. I could start to try opening the notepad file with the following codes.
Private Sub CommandButton1_Click()
Dim File As String, text As String, textline As String
File = "C:\test\test.txt"
File = Application.GetOpenFilename()
Open File For Input As #1
Do Until EOF(1)
Line Input #1, textline
text = text & textline
Loop
Close #1
I can't seem to upload the text file here so i capture the screens and placed it in test.docx. I have attached the excel file (Book_test.xls) for your references.
Basically, i want to copy only three parameters from the notepad namely the, Energy, STD VOLUME and CV, and then paste it to the excel file according to their respective date and time. i hope someone can give me some pointers. Thanks in advance.
I have been trying to build a macro to copy three parameters/data from notepad and copy it to excel. It seems easy but i didn't know how can i start with it. I could start to try opening the notepad file with the following codes.
Private Sub CommandButton1_Click()
Dim File As String, text As String, textline As String
File = "C:\test\test.txt"
File = Application.GetOpenFilename()
Open File For Input As #1
Do Until EOF(1)
Line Input #1, textline
text = text & textline
Loop
Close #1
I can't seem to upload the text file here so i capture the screens and placed it in test.docx. I have attached the excel file (Book_test.xls) for your references.
Basically, i want to copy only three parameters from the notepad namely the, Energy, STD VOLUME and CV, and then paste it to the excel file according to their respective date and time. i hope someone can give me some pointers. Thanks in advance.