Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a workbook with 3 pages. How can I set the curser on each page to a
starting position of cell A1 when the workbook is opened? Preferably, something to the number of sheets in the workbook as they may fluctuate. Thank you, -- Martin |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In the ThisWorkbook module add the following Workbook_Open event.
Private Sub Workbook_Open() Dim sh As Worksheet Dim thisSh As Worksheet On Error GoTo Event_Exit Set thisSh = ActiveSheet Application.ScreenUpdating = False For Each sh In ThisWorkbook.Worksheets sh.Activate Application.Goto Range("A1"), True Next sh thisSh.Activate Event_Exit: Application.ScreenUpdating = True End Sub Hope this helps Rowan Martin wrote: I have a workbook with 3 pages. How can I set the curser on each page to a starting position of cell A1 when the workbook is opened? Preferably, something to the number of sheets in the workbook as they may fluctuate. Thank you, |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi Martin
1. Select the ThisWorkbook sheet in the VBA Editor. 2. Paste in the following code. Private Sub Workbook_Open() Dim wksSheet As Excel.Worksheet For Each wksSheet In ThisWorkbook.Sheets If wksSheet.Type = xlWorksheet Then wksSheet.Activate wksSheet.Range("A1").Activate End If Next ThisWorkbook.Sheets(1).Activate End Sub Each time you open the workbook it will put the cursor for each sheet back to A1. It doesn't matter how many sheets you have in the workbook. HTH Barry "Martin" wrote: I have a workbook with 3 pages. How can I set the curser on each page to a starting position of cell A1 when the workbook is opened? Preferably, something to the number of sheets in the workbook as they may fluctuate. Thank you, -- Martin |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
change default file open position for large shared spreadhseet | Excel Discussion (Misc queries) | |||
Position to first empty cell upon program open | Excel Discussion (Misc queries) | |||
spreadsheet Curser | Excel Discussion (Misc queries) | |||
Default cell position on file open | Excel Discussion (Misc queries) | |||
Position of CellCursor on Screen (absolute position) | Excel Programming |