How to make Excel open at the first column of the chart instead of far right?
As datatoo indicated, the last active cell location has influence on where the workbook opens. If you want to make sure it opens to a certain location I prefer ActivewWindow.ScrollIntoView. Because it does not actually change the saved selection.
Private Sub Workbook_Open()
ActiveWindow.ScrollIntoView 1, 1, 1, 1
End Sub
This will scroll the very top left of your document into the top left of your window.
Normally this is a result of the last active cell location when the file was saved before closing. Unless you have a macro running on the Workbook_Open event that changes that.
If you don't mind a macro in the workbook, or want to force this you might try this
Private Sub Workbook_Open()
Range("A1").Select
End Sub
Thanks to datatoo, I added the suggested line: Range("A1").Select to a script that I already had running to unfilter the workbook on open, and it works perfectly for unfreezing panes if the cell selected is within the frozen area that you want displayed. Thanks!
Here it is, for anyone who wants the whole script. It unfilters the workbook and then shoots over to a selected cell.
NOTES ON USAGE:
- Change "F1" to a cell within the range of what you want displayed on open.
- This is being used on a table I created within Excel called "Tasks."
- Change "Tasks" to the name of your table.
-
It's relevant to repeat the auto filter line because the first instance removes all filters and the second instance puts them back, but with no selections made.
Sub Auto_Open() ActiveSheet.ListObjects("Tasks").Range.AutoFilter ActiveSheet.ListObjects("Tasks").Range.AutoFilter Range("F1").Select End Sub}