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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,222,403
Messages
6,165,852
Members
451,986
Latest member
ExcelIsLove

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
Back
Top