How to Always Start the Same Worksheet When Opening a Workbook in Excel?


When we are working with multiple sheets in Excel, we can see that when we open the workbook, it will always start from the sheet where we last saved. This can lead to some privacy issues in Excel. Sometimes you don’t want that to happen, and you want to open a specific worksheet in the workbook. This tutorial will help you understand how we can always start the same worksheet when opening the same workbook.

Always Start the Same Worksheet When Opening a Workbook

Here we will insert VBA code and then save the code to complete the task. Let us see a simple process to understand how we can always start the same worksheet when opening a workbook in Excel. This process can’t be completed by default in Excel. We will be using the Microsoft VB.NET application in order to complete our process.

Step 1

Let us consider an Excel workbook that contains any number of worksheets; in our case, consider three sheets.

Now, right-click on any sheet name and select View Code to open the VBA Code window, then double-click on this workbook to open a new text box and enter the programme as shown in the below image.

Program

Private Sub Workbook_Open()
'updated by nirmal
Dim xOWSName As String
Dim xWS As Worksheet
   xOWSName = "sheet1"
   Set xWS = Worksheets(xOWSName)
   xWS.Activate
End Sub

Sheet1 is the name of the sheet in the code, which we will always start with.

Step 2

The workbook should be saved as a VBA-enabled template, and the VBA application should be closed by pressing Alt + Q. Now close the sheet, and when you open the sheet next time, click on the enabled code to complete our process as shown in the below image.

Conclusion

In this tutorial, we used a simple example to demonstrate how we can always start the same worksheet when opening a workbook in Excel to highlight a particular set of data.

Updated on: 09-Jan-2023

177 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements