Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would try either of these and see what you get
xlTextMSDOS xlTextPrinter -- Regards, Tom Ogilvy wrote in message oups.com... Thanks, Tom. That's just what I needed. (BTW, the text type will be MS- DOS text, which is what I think Microsoft notepad uses, correct?) Thanks much to NickHK for his input in the next post, too. It is appreciated. Best Regards, Joseph On Feb 13, 8:19 pm, "Tom Ogilvy" wrote: Sub CreateFile() Dim sh asWorksheet, sh1 asWorksheet set sh = Activesheet workbooks.Add Template:=xlWBATWorksheet set sh1 = Activesheet sh.Range("A1:F20").Copy sh1.Range("A1").PasteSpecial xlValues Application.DisplayAlerts = False sh1.parent.SaveAs "C:\Myfolder\Myfile.txt", xlCSV '<== Change Application.DisplayAlerts = True End Sub there are many different formats fortextfiles. You don't say which you want. Also, specify the full path and name of your file. -- Regards, Tom Ogilvy wrote in message oups.com... Can anyone describe how to export the values inrangeA1 to F20 on worksheet'Data' to atextfile? Thetextfile will be named 'routes.txt'. Thetextfile already exists, and it should be overwritten with the new values each time the macro is executed, rather than the macro appending the values to thetextfile. Thanks kindly. Best Regards, Joseph- Hide quotedtext- - Show quotedtext- |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Export range to text file | Excel Discussion (Misc queries) | |||
Simple Export of worksheet contents to text-file. | Excel Programming | |||
macro to export a range to a text file? | Excel Programming | |||
Why can't I Export selected cells to tab-delimited text file? | Excel Discussion (Misc queries) | |||
Export range to text file | Excel Programming |