View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
TimT TimT is offline
external usenet poster
 
Posts: 69
Default Moving sheets to another file

I'm trying to move certain sheets to a selected file and getting a "..out of
range" error.
Help?

Sub SendData()

Dim wb As String
wb = ThisWorkbook.Activate

Dim SendDataFname As String

SendDataFname = Application.SendOpenFilename("Excel files (*.xls),
*.xls")

Workbooks.Open SendDataFname

Sheets(Array("sheet2", "sheet3", "sheet4")).Move _
After:=Workbooks(wb).Sheets("sheet1")
Windows(SendDataFname).Activate
ActiveWorkbook.Save
ActiveWindow.Close

ThisWorkbook.Activate

End Sub