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: 7
Default Run-time error '1004' on hiding worksheets

I have this code in

Private Sub Workbook_Open()
ActiveWorkbook.Sheets("Cost&Marg_01").Activate
Dim sh As Worksheet
For Each sh In ActiveWorkbook.Sheets
If sh.Name < "Cost&Marg_01" Then
sh.Visible = False
Else
sh.Visible = True
End If
Next
End Sub

I get an applicaton defined or object defined error when it gets to the
sh.Visible=False line.

What have I improperly defined here?

Brent

 
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
Run-time error 1004 while conditionally hiding rows as a result ofworksheet protection ran58 Excel Discussion (Misc queries) 2 July 22nd 09 07:42 AM
1004 Error when hiding/unhiding rows ianb Excel Discussion (Misc queries) 5 March 27th 08 08:42 AM
Run-Time error '1004' [email protected] Excel Discussion (Misc queries) 3 March 29th 06 08:13 PM
Run time error 1004, General ODBC error [email protected] New Users to Excel 0 September 19th 05 01:41 AM
Run-time error 1004 JimFor Excel Programming 4 December 14th 04 10:19 PM


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