Help with macro(saveas)

  • Thread starter Thread starter Ola Sigurdh
  • Start date Start date
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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top