Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Won't Compile

I am trying to come up with a VB routine IN XL2007 which hides all but a
specified sheet. In the test routine I have written the specified sheet is
the first sheet, but this is arbitrary. I would be most grateful if someone
could explain the error I get when I try to compile the following:

Sub Testsub()
Dim Sheet, Sheet_ As Worksheet, I As Integer
Set Sheet = ActiveWorkbook.Sheets(1)
MsgBox ActiveWorkbook.Sheets.Count
For I = 1 To ActiveWorkbook.Sheets.Count
Set Sheet_ = ActiveWorkbook.Sheets(I)
If Sheet_ < Sheet Then Sheet_.Hide
Next
Sheet.Activate
End Sub


--
-regards
 
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
Compile Error. Else without If? PaulW Excel Discussion (Misc queries) 6 September 1st 06 03:38 PM
Compile Error on Chr(13) scottfoxall Excel Discussion (Misc queries) 3 August 22nd 06 12:34 PM
compile data mike1 Excel Discussion (Misc queries) 1 July 8th 06 02:44 AM
help help help compile error ashw1984 Excel Discussion (Misc queries) 1 January 30th 06 12:45 PM
compile errors johnny Excel Discussion (Misc queries) 1 February 24th 05 11:49 PM


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