ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Q - Open Specific Sheet (https://www.excelbanter.com/excel-programming/424443-q-open-specific-sheet.html)

Seanie

Q - Open Specific Sheet
 
I have the code below under ThisWorkbook, but it returns an error
"Compile Error in Hidden Module: ThisWorkbook" - why is that? My sheet
"Header" is not hidden, although I do have other sheets hidden

Private Sub Workbook_Open()

Application.ScreenUpdating = False
Worksheet("Header").Activate

End Sub

Bernard Liengme

Q - Open Specific Sheet
 
This works for me
Private Sub Workbook_Open()
Worksheets("Sheet3").Activate
End Sub

1) I have "Worksheets" with an S at the end
2) This module in a workbook module. In Excel 2003 (and before), click the
Excel logo next to File in the Menu Bar and use View Code - this is where
the module should be. OR, in any version, open the VB editor and then open
the ThisWorkbook module for the workbook in question.

best wishes

--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Seanie" wrote in message
...
I have the code below under ThisWorkbook, but it returns an error
"Compile Error in Hidden Module: ThisWorkbook" - why is that? My sheet
"Header" is not hidden, although I do have other sheets hidden

Private Sub Workbook_Open()

Application.ScreenUpdating = False
Worksheet("Header").Activate

End Sub




Seanie

Q - Open Specific Sheet
 
Damn! I'd been looking at it for ages

Thanks

OssieMac

Q - Open Specific Sheet
 
Try worksheets with an s on the end.

Application.ScreenUpdating = False
Worksheets("Header").Activate
--
Regards,

OssieMac


"Seanie" wrote:

I have the code below under ThisWorkbook, but it returns an error
"Compile Error in Hidden Module: ThisWorkbook" - why is that? My sheet
"Header" is not hidden, although I do have other sheets hidden

Private Sub Workbook_Open()

Application.ScreenUpdating = False
Worksheet("Header").Activate

End Sub



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com