Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you copy a used range to a text document?

Status
Not open for further replies.

mxp346

MIS
Apr 27, 2002
50
0
0
US
I have a worksheet called Scripts that will have a different number of rows, but the data will always be in column A. What I would like to do is save the used range on the Scripts sheet to a text file. I do not want the other worksheets to be saved to the text file. I'm not really sure where to start with this one, so any help would be appreciated. Thank you very much.
 
Hi,

This can be done using Save As... and selecting a text file.

Turn on you macro recorder as you save as and you'll have a macro!

:)

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at faq222-2244
 
Anyone have any better methods? I do not want to then have to do a save as again to save the file back to an .xls file.
 
If you do a Save and then SaveAs to the text file, what's wrong with that? You can RECORD what you want done so that all it takes is a button click or a keyboard shortcut.

You must know, but perhaps you do not since you are not a professional programmer, that programming is alot of tedious detail like what you care to avoid. Are there other ways? Of course! You could Open a file for Output, loop thru each row of data on your sheet to write each line to the file and then Close the file. Thats a pretty standard routine. But you'd have to code it.

I gave you a suggestion that you could RECORD and with a minimum of modification (maybe none) and implement.

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at faq222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top