Always open a workbook on Sheet1 regardless of sheet viewed when lastsaved

M

Michael Lanier

Is there a macro that will always open a workbook on a designated
worksheet regardless of what sheet the file was saved on when last
visited? I would like to always open the workbook on Sheet1 if the
value of Sheet1!A1>0. Thanks for any help.

Michael
 
B

Bob Phillips

Private Sub Workbook_Open()
With Me

If .Worksheets("Sheet1").Range("A1").Value > 0 Then

.Worksheets("Sheet1").Activate
End If
End With
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top