View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Ken Johnson
 
Posts: n/a
Default jump to active cell in other sheet .

Hi Mai,
I'm not sure I follow your question.
If you want A1 to be the active cell when Sheet1 is activated, A2 to be
the active cell when Sheet2 is activated, A3 to be the active cell when
Sheet3 is activated, A4 to be the active cell when Sheet4 is activated
etc up to Sheet10, where the active cell upon activation will be A10;
then one way is to paste this code into the ThisWorkbook code module:

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Range("A" & Right(Me.ActiveSheet.Name, Len(Me.ActiveSheet.Name) -
5)).Select
End Sub

To get the code into the ThisWorkbook code module..
1. Copy the above code.
2. Right click any of the worksheet tabs to view the contextual menu.
3. Select View code from the contextual menu
4. If the Project Explorer is not visible then go ViewProject Explorer
5. Double click the ThisWorkbook icon to open that code module
6. Paste the code into the blank module.
7. Press Alt + F11 to exit the VBA Editor