Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Error when moving sheet


Hi

I have this code for moving a sheet:

Workbooks.Open Filename:=a & "situatie_qsar.xls"
Workbooks.Open Filename:=a & "situatie_qsar_z.xls"
Sheets("situatie_qsar_z").Move
After:=Workbooks("situatie_qsar.xls").Sheets(1)

At the thired line I recive this error:
Run time error 9: Subscript out of range

Why?
The two files are exported from a program in "Microsoft Excel 2.1
Worksheet" format and I'm using Excel 2000.


--
mihai
------------------------------------------------------------------------
mihai's Profile: http://www.excelforum.com/member.php...fo&userid=2808
View this thread: http://www.excelforum.com/showthread...hreadid=276607

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default Error when moving sheet

Hi

place the After line on the same line as the .Move command e.g.
Workbooks.Open Filename:=a & "situatie_qsar.xls"
Workbooks.Open Filename:=a & "situatie_qsar_z.xls"
Sheets("situatie_qsar_z").Move
After:=Workbooks("situatie_qsar.xls").Sheets(1)


Cheers
JulieD

"mihai" wrote in message
...

Hi

I have this code for moving a sheet:

Workbooks.Open Filename:=a & "situatie_qsar.xls"
Workbooks.Open Filename:=a & "situatie_qsar_z.xls"
Sheets("situatie_qsar_z").Move
After:=Workbooks("situatie_qsar.xls").Sheets(1)

At the thired line I recive this error:
Run time error 9: Subscript out of range

Why?
The two files are exported from a program in "Microsoft Excel 2.1
Worksheet" format and I'm using Excel 2000.


--
mihai
------------------------------------------------------------------------
mihai's Profile:
http://www.excelforum.com/member.php...fo&userid=2808
View this thread: http://www.excelforum.com/showthread...hreadid=276607



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Error when moving sheet


Subscript out of range in this case probably means that the sheet
'situatie_qsar_z' doesn't exist.

mihai Wrote:
Hi

I have this code for moving a sheet:

Workbooks.Open Filename:=a & "situatie_qsar.xls"
Workbooks.Open Filename:=a & "situatie_qsar_z.xls"
Sheets("situatie_qsar_z").Move
After:=Workbooks("situatie_qsar.xls").Sheets(1)

At the thired line I recive this error:
Run time error 9: Subscript out of range

Why?
The two files are exported from a program in "Microsoft Excel 2.1
Worksheet" format and I'm using Excel 2000.



--
crispbd
------------------------------------------------------------------------
crispbd's Profile: http://www.excelforum.com/member.php...o&userid=10880
View this thread: http://www.excelforum.com/showthread...hreadid=276607

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
formula for moving information from one sheet to another sheet Puzzled Excel Discussion (Misc queries) 4 June 6th 10 05:58 AM
Error moving from 2003 to 2007 Bishop Excel Worksheet Functions 2 November 3rd 09 04:13 PM
moving from one sheet to another from a cell of a sheet mah1608 Excel Worksheet Functions 1 May 8th 09 06:27 AM
Sumproduct and moving sheets between workbooks error Tim879 Excel Discussion (Misc queries) 2 September 22nd 08 10:14 PM
moving informatiion from one sheet to a total sheet john Excel Discussion (Misc queries) 2 January 31st 08 10:17 PM


All times are GMT +1. The time now is 10:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"