Code for Excel Macros- Editing the Notepad

Himaja

Board Regular
Joined
Oct 14, 2013
Messages
62
Can any one help in providing the code for the below scenario:

I will browse for an excel file which has columns like: Line Number, Length, Value
Using Excel Macros, I have to open an existing text file, make the changes in it with the values in the "value" column of Excel from Line Number and Column no. specified in the excel.

Save the modified text file in a particular path
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
I can't reproduce what you are seeing. What's in your Input workbook.

The problem is with the FileFormat: xlTextPrinter

Output text file is having the below numbers:

15
15
22
22
15
15
15
22

Actually these numbers are the last numbers in the lines that starts with CLS

CLS444444444WC WC35693601 2012071520130715 BINGLEY, CAROLINE 000000003 VA881002ACLERICAL OFFICE EMPLOYEES N O C N0 00000000040019000000000000000020130201201302152013030120130225004 777000012126 00015

After 00015 I have 9 spaces.
While copying as xlTextPrinter, it is taking till 000 and leaving 15 and spaces.
This 15 is coming down
 
Upvote 0
Please put you original text file on a share like Box.net so that I can check what's happening.

I dont have access to shared paths.
Can you pls tell me which point you didnt understood?

Is there any way to attch the files here itself so that i can attach here only.....
 
Upvote 0
I can't reproduce what you are seeing if there are spaces at the end of a line.

You can't attach file here. Do you want to attach it to an Email?
 
Upvote 0
I can attach it to an email.
Actually when searched in net, it is given like, xltextprinter stores only 240 chars.
In my case it is correct. My text file has lines of length 252.
Till 240 it is fine and the remaining is ignored.
That is the reason, the remaining chars are coming at the last

Can you tell me an email, i can attch to that mail and sent it to you?
 
Upvote 0
When i copy/paste from the text file, each line in my text file is pasted here as 3 lines.
Except the first and last line all the middle lines are 251 chars length
 
Upvote 0

Forum statistics

Threads
1,215,945
Messages
6,127,844
Members
449,411
Latest member
adunn_23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top