Help with macro(saveas)

O

Ola Sigurdh

Hello

I have this short macro that´s not working
Sub Save_sheets()
Sheets("Faktura" & "Materialspec" & "Diverse").Select
Selection.SaveAs Filename:="C:\VVS\Fakturor\" & Range("F5") & "xls",
FileFormat:=xlTextWindows
End Sub
What I try to do is saving three different sheets in a workbook with seven
sheets to a new workbook. I get an error message which say´s index outside
the interval. What is wrong

TIA
OLA
 
B

BrianB

I suggest that you set the macro recorder and do the job manually to ge
the code that you want. You will find that it is very different to wha
you have written.

You have to copy the 3 sheets to a new workbook and save that.

I do not think that you will be able to save 3 sheets as xlTextWindow
because this text-only format is used by text editors which can onl
handle single sheet files.

You omitted the dot delimiter from ".xls" in the file name.

Hope this helps
 
O

Ola Sigurdh

Thank´s Brian
I have tried to do use the macro recorder but if I select 3 sheets and try
to do a save as it saves the whole workbook instead of just the three
sheets I want. But I will try to copy it instead

Ola
 
Top