Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can copy that sheet to a new workbook and save it from there.
Option Explicit Sub testme() Dim wks As Worksheet Dim newWks As Worksheet set wks = worksheets("whateveroneyouwanthere") wks.Copy 'to a new workbook Set newWks = ActiveSheet With newWks Application.DisplayAlerts = False .Parent.SaveAs Filename:="C:\TEMP\" & .Name & ".txt", _ FileFormat:=xlCSV Application.DisplayAlerts = True .Parent.Close savechanges:=False End With End Sub Judy Ward wrote: I have an Excel file with more than one worksheet. With the Excel file open, I want to save one of the sheets as a csv file (but name it with a .txt extension) and leave the original file open (still as an Excel file) to continue working with it. I have tried using the SaveAs function and I end up with both the sheet and the original file with a .txt extension--not what I want. I have also figured out how to create both files IF I close both files--also not what I want. I have searched online and have not come up with any help for this scenario. I would really appreciate advice from someone who can get this working. Thank you, Judy -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to Save just one sheet to new workbook. | Excel Worksheet Functions | |||
how do I get a macro to save a sheet and set the file name? | Excel Discussion (Misc queries) | |||
How can I save my sheet in macro | Excel Discussion (Misc queries) | |||
How do I save each sheet as a separate .xls file by using macro? | Excel Programming | |||
is it possible to change this macro to save each sheet seperately? | Excel Programming |