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" <excel_hari@hotmail.com> wrote in message
news:uR33rytBFHA.1836@tk2msftngp13.phx.gbl...
> 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
>
>