LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Stumped on Array

Excel 2002, WinXP
I've shortened the code to show my problem. The object here is to move some
sheets to the far left. The code is:
Option Explicit
Public ExemptList() As String

Sub Macro1
Call BuildExemptArray
Call MoveExemptSheets
End Sub

Sub BuildExemptArray()
ReDim ExemptList(1 To 3)
ExemptList(1) = "AddrList"
ExemptList(2) = "ChkList"
ExemptList(3) = "ClientShtsList"
End Sub

Sub MoveExemptSheets()
Dim c As Long
For c = UBound(ExemptList) To LBound(ExemptList) Step -1 '**Problem
line
Sheets(ExemptList(c)).Move Befo=Sheets(1)
Next
End Sub

This code is straightforward and I've used it before, but now I am getting a
"Subscript out of range'" error on the "For c =" line.
I can see I might get this error with the subsequent line if one of the
array sheets didn't exist or is hidden, but I can't see a reason for this
error with this line.
Thanks for your help. Otto


 
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
Still stumped LarryK Excel Worksheet Functions 7 March 30th 09 11:15 AM
Stumped bad, need help please! Kevin Excel Worksheet Functions 10 April 12th 08 10:36 PM
Stumped GD Excel Discussion (Misc queries) 4 January 21st 08 02:12 PM
STUMPED Suzanne Kelzer Excel Worksheet Functions 2 June 21st 07 03:36 PM
stumped ?? my Excel Worksheet Functions 2 April 13th 06 12:32 PM


All times are GMT +1. The time now is 06:30 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"