VBA- Error

Giganews Newsgroups
Subject: VBA- Error
Posted by:  dipsy (dipsydoodler…@yahoo.com)
Date: Mon, 20 Oct 2003

Hi:  I get "Subscript out of Range Error when I run this
code - any help is appreciated.  Thanks in advance.

Dim CapSheetName(2) As String
        CapSheetName(0) = "Capitalized Expenditures_Hrs"
        CapSheetName(1) = "Capitalized Expenditures_%"

        For Each CapName In CapSheetName
            If sheets(CapName).Visible = True Then
              sheets(CapName).Activate
              ActiveSheet.Visible = False
            End If
        Next

Replies