Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In code: create a new workbook, copy the range to the new workbook, saveas a
text file. Dim rng as Range set rng = Range("A1").CurrentRegion Workbooks.Add rng.copy Destination:=Activesheet.Range("A1") Activeworkbook.SaveAs Filename:="C:\data\mytext.csv, _ Fileformat:=xlCSV Activeworkbook.close Savechanges:=False -- Regards, Tom Ogilvy msnews.microsoft.com wrote in message ... How do I programmatically extract data from a worksheet (a range, not the entire sheet) to a text file? What I am doing now is selecting the data I want with my mouse and copying it. I then paste it to notepad and save it. I would like to do this automatically from an external script, preferably VBScript. Thanks in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Saving Text File | Excel Discussion (Misc queries) | |||
Text file saving, setting file origin | Excel Discussion (Misc queries) | |||
saving a text file to excel | Excel Worksheet Functions | |||
Saving sheet to text file | Excel Discussion (Misc queries) | |||
saving an excel file as text without text in quotes | Excel Discussion (Misc queries) |