How to open a specific worksheet at a specific location automatically when the Excel workbook opens using VBA. Watch the video below:
When we open a workbook with multiple worksheets then only the worksheet and the range or cell location opens which were selected before closing. Now what if we wish to always open a specific worksheet at a specific location no matter how we closed the workbook? We can achieve this automation in Excel using the following code:
Private Sub Workbook_Open()
Worksheets(“DataEntry”).Activate
Dim lastrow As Long
lastrow = Application.WorksheetFunction.CountA(Range(“A:A”))
lastrow = lastrow + 1
Range(“A” & lastrow).Activate
End Sub
What is the advantage of such an automation? The major advantage is time saving because we wish to continue our data entry where we left off without having to search for the relevant worksheet.
