Saving text from a cell to a TXT file

mark hansen

Well-known Member
Joined
Mar 6, 2006
Messages
534
Office Version
  1. 2016
Platform
  1. Windows
How can I drop the contents of a cell to a .TXT file?

I have a cell that has a formula, that formula has a concatenate statement that pulls text from other cells into a long text string. Normally I copy and paste that into other programs. I'd like to save that text to a .TXT file so another program can use it in a little better fashion.

Thanks for any help.
Mark
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Try like this

Code:
Sub WriteText()
Dim iMyFreeFile As Integer
iMyFreeFile = FreeFile
Open "C:\xltext.txt" For Output As #iMyFreeFile
Write #iMyFreeFile, Range("A1").Value
Close #iMyFreeFile
End Sub
 
Upvote 0
Thanks Vog. Very helpful. Now that I know what the commands are, I did some searches for some great ideas I didn't know I wanted to do.

Thanks
Mark
 
Upvote 0

Forum statistics

Threads
1,224,582
Messages
6,179,670
Members
452,936
Latest member
anamikabhargaw

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