Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save range to text file.
I need to create a text file, containing a range of cells in a
worksheet. I recorded the following macro to selct the range, paste special as text into a seperate worksheet, and save the worksheet containing the text to a text file. This works, but also saves the entire workbook as a new workbook in text format. I would like find a way to export the range directly into a text file, or be able to save the worksheet caontaing the text without saveing teh entire workbook as text. I have seen some example here, but they are somewhat complicated, and I can not get them to out put the range I need (G15:J25). Can someone suggest a modification to output the range to a text file without saving the workbook as a text file. Thanks Sub Macro1() ' ' Macro1 Macro ' ' Range("G15:J25").Select Selection.Copy Sheets("lookuptable").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = False ChDir "C:\Users\David\Desktop" ActiveWorkbook.SaveAs Filename:= _ "C:\Users\David\Desktop\lookuptable.txt", FileFormat _ :=xlText, CreateBackup:=False Sheets("calibration").Select End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do you save an excel file to be read as IBM-type text file ? | Excel Worksheet Functions | |||
Save a selected range to a new text file in excel | Excel Discussion (Misc queries) | |||
How can I save a file as a comma-delimited text file in Excel? | Excel Discussion (Misc queries) | |||
Excel VBA - open text file, replace text, save file? | Excel Programming | |||
Save As - Multiple Sheets fails to save as text file | Excel Programming |