Consulting

Results 1 to 6 of 6

Thread: Sleeper: Move Cursor Of Second Sheet As Per The First Sheet

  1. #1

    Arrow Sleeper: Move Cursor Of Second Sheet As Per The First Sheet

    Move cursor of second sheet as per the first sheet

    In my workbook, sheets are as follows..

    FARES1, FARES2, CONDITIONS1, CONDITIONS2, UPSELL1, UPSELL2, RULES1, RULES2, VALIDITY1, VALIDITY2, ROUTING1, ROUTING2, ZONES1, ZONES2.
    Likewise applies in all.

    Means if Range ("A1") is selected on FARES1, then select same in FARES2.

    Plz note: Sheets may contains by any names.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    What a strange request!


    Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
    Dim ws As Worksheet
    On Error GoTo ws_exit:
        Application.EnableEvents = False
        If IsNumeric(Right(Sh.Name, 1)) Then
            For Each ws In ThisWorkbook.Worksheets
                If IsNumeric(Right(ws.Name, 1)) Then
                    If UCase(Left(ws.Name, Len(ws.Name) - 1)) = _
                        UCase(Left(Sh.Name, Len(Sh.Name) - 1)) Then
                        If ws.Name <> Sh.Name Then
                            ws.Activate
                            ws.Range(Target.Address).Select
                            Sh.Activate
                        End If
                    End If
                End If
            Next ws
        End If
    ws_exit:
        Application.EnableEvents = True
    End Sub

    This is workbook event code. To input this code, right click on the Excel icon on the worksheet (or next to the File menu if you maximise your workbooks), select View Code from the menu, and paste the code

  3. #3
    Working perfect.

    But it is not scrolling the window so as to easily view the data of the particular sheets

  4. #4
    If you press the button marked 'Caps Lock' it stops typing in capitals, it's a miracle you should try it out one time :P

  5. #5
    can v get zoom view and sroll view also???

  6. #6
    can v get zoom view and sroll view also???
    But required the output if only sheet is selected.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •