Skip to main content

How to extract excel cells values/content in a .txt file?

To solve this problem you need to use macros in excel sheets.
You need to enable Developer toolbar in Excel 2007/2010 to use macros.
A simple VB script can handle this task.
In the VB toolbar just copy and run the below script and enjoy.

Sub a()
Open "<path>\file_output.txt" For Output As #1
Dim i As Integer
For i = 1 To 15
Print #1, Cells(i, 4)
Print #1, Cells(i, 5)
Print #1, "  "
Next i
Close #1
End Sub

In the above example script, 
a is the macro name. 
<path> needs to be specified where the required output file needs to be created.
In the for loop Cells(i, 4) and Cells(i, 5) specifies 4th column and 5th column of opened excel sheet. You can change according to your needs.
For further queries ask in the below comment section.

Popular posts from this blog

eLitmus pH test for freshers

eLitmus has became more famous in conducting pH test for the fresh graduates in India. They will evaluate candidates across India and to provide a standard benchmark against which companies can compare them.

Who can apply

Candidates having/pursuing a degree in BE/B.Tech, MCA, ME/M.Tech or M.Sc(CS/IT) can apply for the pH test.

Companies recruiting from pH test

List of companies

Look at test centers

Check the upcoming pH tests

Look at the testimonials

Read what the candidates appeared for this exam says about eLitmus.

Test Pattern

Test duration : 2 hours
No of questions : 60

It will be asked from 3 categories,


20 : Problem solving
20 : Verbal ( You need to read the paragraph and answer the questions )
20 : Quantitative ( Data interpretation )

Four options will be provided for each question. Test will be conducted online.

Payment methods

Fresh graduates appearing for the test has to pay Rs 920/- as a test fee.

They can pay online or send a DD or in cash at Bangalore eLitmus office.

By Online: If y…