Defaults

liam_conor

Board Regular
Joined
Oct 9, 2002
Messages
180
I need my workbook to always display each worksheet at the A1 cell location. Also, when I close my workbook I want it to revert to the first worksheet in the workbook when it is openened. Any suggestions?
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

royUK

Well-known Member
Joined
Jul 24, 2002
Messages
1,606
To select A1 put this in the Worksheet activate - right click on the worksheet tab and select View Code, in the right hand dropdown screen that is displayed choose "Activate" and then paste.

Private Sub Worksheet_Activate()
Range("A1").Select
End Sub

Similarly in the Workbook _Open paste

Private Sub Workbook_Open()
Sheet1.Select
End Sub
This message was edited by royUK on 2002-10-10 09:47
 

lenze

Legend
Joined
Feb 18, 2002
Messages
13,690
Right click on the Excel icon to the left of the File menu on the menu bar. Choose view code. Enter this

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Sheet1.Activate
Range("$A$1").Select
End Sub

This will cause the Workbook to open on Sheet1 with $A$1 selected. If you want each sheet to always open at $A$1, the add this code

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
ActiveSheet.Range("$A$1").Select
End Sub

HTH

Sorry royUK: I didn't see your post
This message was edited by lenze on 2002-10-10 09:52
 

Forum statistics

Threads
1,143,915
Messages
5,721,506
Members
422,369
Latest member
redinator

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top