View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Hari Prasadh Hari Prasadh is offline
external usenet poster
 
Posts: 63
Default Saving a column of data in another file format

Hi Bob,

Thnx for a different way. Now, I know that anytime I want to save a workbook
in text file kind of thing I can use -- FileFormat:=xlTextMSDOS--

It's a little funny. If in VBA help I type -- xlTextMSDOS-- it will say --
please rephrase your question-- On the other hand if I type -- save as -- in
search and then go to -- save as method -- SaveAs method as it applies to
the Chart and Worksheet objects.-- then click on --see the FileFormat
property-- Read-only XlFileFormat -- I get a list which includes
xlTextMSDOS.

If the text xlTextMSDOS is there in the help file why doesnt my help show it
in the first enter itself. Does everybody have to go on a treasure hunt for
finding info or can i tweak something to do it in a more efficient manner.

Thanks a lot,
Hari
India

"Bob Phillips" wrote in message
...
Hari,

How about this

Sub CreateSPS()
ActiveSheet.Copy
Rows("1:1").Delete Shift:=xlUp
Columns("B:IV").Delete Shift:=xlToLeft
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"C:\MyTest\Hari.sps", FileFormat:=xlTextMSDOS
End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Hari Prasadh" wrote in message
...
Hi,

I want to copy data in column A (starting from row number 2 to variable
length) and save it as a *.sps file. (Formats dont matter, just the

values
to be copied)

Basically .sps is syntax file format of SPSS.

I Started the macro recorder and then copied the specified range, went

to --
Start -- Run -- Notepad - Ctrl +V - Ctrl +S - then choose file extension

as
all files and typed the name as -- trying.sps -- (I didnt open SPSS and

then
a new syntax file and then paste it there because it takes some time, so
i
thought why not paste in to Notepad and save it as *.Sps extension. ---
Basically if a notepad is saved as .sps extension it cane be opened up in
spss for viewing)

And the result was

Sub Macro1()

Range("a2:a2050").Select
Selection.Copy

End Sub

Macro recorder has not recorded any action outside the excel environment.
How do I go about it?

I have modified the above code to below.. Please guide me beyond this.

Range(Cells(2, "a"), Selection.End(xlDown)).Select
Selection.Copy


Thanks a lot,
Hari
India