LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
JPW JPW is offline
external usenet poster
 
Posts: 6
Default export excel spreasheet into a text file

Double-click on ThisWorkbook in your VBA Project and add a sub with the line
I gave you below. For example:

Public Sub SaveAsTXT()
ThisWorkbook.SaveAs Filename:="MyText.txt", FileFormat:=xlTextWindows
End Sub

Then assign this macro to the button you want from within your workbook. You
can assign macros to pictures, this would be the simplest way. Right-click
your image and choose "Assign Macro," then pick your SaveAsTXT macro from
the list.

"Slinjger" wrote in message
...
I would like to automate the task by using a button to do the write to a
file
- pretty much a newbie when it comes to VBA

"JPW" wrote:

By hand?

File - Save As
Under "Save as type:" choose Text (Tab Delimited) or CSV (Comma
Delimited)

....or from within a VBA event?

ThisWorkbook.SaveAs Filename:="MyText.txt", FileFormat:=xlTextWindows

"Slinger" wrote in message
...
I have a worksheet in a workbook that I would like to export out as a
text
file and not affect the workbook, and name the text file to save as.






 
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 can I export text from excel autoshapes to a text file? Donncha Excel Discussion (Misc queries) 0 July 20th 06 04:58 PM
export excel file as csv with text delimiter of " John Excel Discussion (Misc queries) 2 May 12th 05 05:50 PM
Export excel file to semicolon delimited text file capitan Excel Discussion (Misc queries) 5 April 7th 05 03:06 AM
How can I export cell content in Excel to a text file? documentum_dan Excel Programming 1 February 7th 05 05:16 PM
export a text file which more than 65536 rows into excel Navin Excel Programming 2 November 19th 03 10:55 PM


All times are GMT +1. The time now is 02:22 PM.

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

About Us

"It's about Microsoft Excel"