Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you save an excel file to be read as IBM-type text file ? Dee Franklin Excel Worksheet Functions 2 October 10th 06 02:46 AM
Save a selected range to a new text file in excel [email protected] Excel Discussion (Misc queries) 0 October 3rd 06 11:27 PM
How can I save a file as a comma-delimited text file in Excel? LAM Excel Discussion (Misc queries) 1 May 3rd 05 10:24 PM
Excel VBA - open text file, replace text, save file? Cybert Excel Programming 2 October 2nd 04 01:05 AM
Save As - Multiple Sheets fails to save as text file Ravee Srinivasan Excel Programming 2 November 10th 03 04:05 PM


All times are GMT +1. The time now is 02:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"