Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I export text from excel autoshapes to a text file? | Excel Discussion (Misc queries) | |||
export excel file as csv with text delimiter of " | Excel Discussion (Misc queries) | |||
Export excel file to semicolon delimited text file | Excel Discussion (Misc queries) | |||
How can I export cell content in Excel to a text file? | Excel Programming | |||
export a text file which more than 65536 rows into excel | Excel Programming |