Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default ActiveSheet.Next.Select not working!

I have a procedure that goes through certain worksheets in
a number of workbooks and extracts data and then moves (or
is supposed to move) via a loop on to the next sheet using
the following code - 'ActiveSheet.Next.Select', the next
line of code being 'GoTo Resumeline'

The procedure works fine until it come to one particular
sheet at which point it jumps out of the loop to an error
handling routine, which keeps the procedure running on the
same sheet without going on to the next sheet, and thus
never getting out of the loop.

Anyone got any idea why this could be happening?

TIA
Ron
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default ActiveSheet.Next.Select not working!

Ron,

Are you sure you are not trying to get the next worksheet of the
last worksheet in the workbook?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Ron McCormick" wrote in message
...
I have a procedure that goes through certain worksheets in
a number of workbooks and extracts data and then moves (or
is supposed to move) via a loop on to the next sheet using
the following code - 'ActiveSheet.Next.Select', the next
line of code being 'GoTo Resumeline'

The procedure works fine until it come to one particular
sheet at which point it jumps out of the loop to an error
handling routine, which keeps the procedure running on the
same sheet without going on to the next sheet, and thus
never getting out of the loop.

Anyone got any idea why this could be happening?

TIA
Ron



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default ActiveSheet.Next.Select not working!

Thanks, Chip

No it wasn't the last worksheet. I found that a user had
left a stray bit of code on the next sheet that was
meaningless and consequentlly throwing the procedure into
the error routine.

Thanks for your suggestion.

Regards
Ron
-----Original Message-----
Ron,

Are you sure you are not trying to get the next worksheet

of the
last worksheet in the workbook?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Ron McCormick" wrote in

message
...
I have a procedure that goes through certain worksheets

in
a number of workbooks and extracts data and then moves

(or
is supposed to move) via a loop on to the next sheet

using
the following code - 'ActiveSheet.Next.Select', the

next
line of code being 'GoTo Resumeline'

The procedure works fine until it come to one particular
sheet at which point it jumps out of the loop to an

error
handling routine, which keeps the procedure running on

the
same sheet without going on to the next sheet, and thus
never getting out of the loop.

Anyone got any idea why this could be happening?

TIA
Ron



.

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
Select the ActiveSheet & the sheet next to it Dolphinv4 Excel Discussion (Misc queries) 1 December 11th 07 02:13 PM
ctrl select not working in 07 BorisS Excel Discussion (Misc queries) 3 April 10th 07 03:51 PM
activesheet.tab.colorindex not working when workbook shared Martin Appleton Excel Discussion (Misc queries) 0 July 21st 06 08:45 AM
Working with Macros-Activesheet.Paste lunar1085 Excel Discussion (Misc queries) 0 February 3rd 06 04:13 PM
activesheet - select rows Rubble[_2_] Excel Programming 0 September 9th 03 03:06 AM


All times are GMT +1. The time now is 09:12 PM.

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

About Us

"It's about Microsoft Excel"