ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to make A1 the active cell in all visible worksheets ? (https://www.excelbanter.com/excel-programming/437653-how-make-a1-active-cell-all-visible-worksheets.html)

Luc[_7_]

How to make A1 the active cell in all visible worksheets ?
 
......so that when i activate the sheet A1 is the cell in the upper left corner of my screen.

Thanx

Patrick Molloy

How to make A1 the active cell in all visible worksheets ?
 
in the dev environment (ALT+F11) open the project explorer (Ctrl+R), then right click the icon for ThisWorkbook and select View Code
add this code|:

Option Explicit
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Range("A1").Select
End Sub
"Luc" wrote in message ...
.....so that when i activate the sheet A1 is the cell in the upper left corner of my screen.

Thanx

Mike H

How to make A1 the active cell in all visible worksheets ?
 
Hi,

ALT+F11 to open VB editor. Double click 'ThisWorkbook' and paste the code in
on the right

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Application.Goto ActiveSheet.Range("A1"), scroll:=True
End Sub

Mike

"Luc" wrote:

......so that when i activate the sheet A1 is the cell in the upper left corner of my screen.

Thanx


Luc[_7_]

How to make A1 the active cell in all visible worksheets ?
 
Patrick, Mike : Thanks for your help !!!!

Luc


"Mike H" schreef in bericht
...
Hi,

ALT+F11 to open VB editor. Double click 'ThisWorkbook' and paste the code
in
on the right

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Application.Goto ActiveSheet.Range("A1"), scroll:=True
End Sub

Mike

"Luc" wrote:

......so that when i activate the sheet A1 is the cell in the upper left
corner of my screen.

Thanx




All times are GMT +1. The time now is 10:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com