Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try this
Private Sub Workbook_Open() On Error GoTo Errhandler Const sheetName = "Sheet1" 'Replace "Sheet1" with the name of sheet1 Dim sh1 As Worksheet Set sh1 = Worksheets(sheetName) sh1.Activate Exit Sub Errhandler: Select Case Err Case 9: MsgBox "Missing" & " " _ & "Worksheet Name: " & sheetName Exit Sub Case Else: MsgBox "Error#:" & Err.Number & vbCrLf & Error$ Exit Sub End Select End Sub "Cheyenne" wrote: Is it possible to write code in excel so that when I open a certain workbook, it always opens to a specific sheet. I know if you save it on a specific sheet, it will open there the next time, but I want to be able to save anywhere in the workbook and have it open to "Sheet1" everytime. -- Cheyenne |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Convert a Number Code to a Text Code | Excel Discussion (Misc queries) | |||
How to code it in excel? | Excel Worksheet Functions | |||
Unprotect Code Module in Code | Excel Discussion (Misc queries) | |||
copying vba code to a standard code module | Excel Discussion (Misc queries) | |||
VB Code and Excel | Excel Worksheet Functions |