View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
gloryofbach[_4_] gloryofbach[_4_] is offline
external usenet poster
 
Posts: 1
Default Saving a sheet in a workbook as .csv but not changing workbook name


Hi everyone,

Thanks for your help on my previous question, it has led me to another
problem:

I have a workbook called work.xls with three sheets, one of which is
called data.

I want to save a copy of data sheet as a csv file called data.csv. This
is easily done using the below code. My problem is I do not want the
name of the current sheet to change when I have done this. In other
words I don't want to save the current workbook as data.csv, but just
the sheet "data". The workbook should remain as work.xls.

This is the code that doesnt work properly:

Sheets("Data").Select
Range("A1").Select

ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Alex\Desktop\data.csv", FileFormat:=
_
xlCSV, CreateBackup:=False


--
gloryofbach
------------------------------------------------------------------------
gloryofbach's Profile: http://www.excelforum.com/member.php...o&userid=28322
View this thread: http://www.excelforum.com/showthread...hreadid=480090