PDA

View Full Version : Move Cursor Of Second Sheet As Per The First Sheet



ilyaskazi
05-25-2005, 02:57 AM
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.

IF I M MOVING MY CURSOR IN SHEET OF FARES1, THEN CHANGE IN FARES2. ELSE IF I M MOVING ON FARES2, THEN CHANGE IN FARES1. LIKEWISE APPLIES FOR ALL.

MEANS, IF RANGE("A1") IS SELECTED ON FARES1, THEN SELECT SAME IN FARES2.

PLZ NOTE: SHEETS MAY CONTAINS BY ANY NAMES.

xld
05-25-2005, 03:20 AM
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

ilyaskazi
05-25-2005, 03:43 AM
WORKING PERFECT.

BUT IT IS NOT SCROLLING THE WINDOW SO AS TO EASILY VIEW THE DATA OF THE PARTICULAR SHEETS

Regouin
05-25-2005, 06:47 AM
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

ilyaskazi
05-26-2005, 04:22 AM
can v get zoom view and sroll view also???

ilyaskazi
05-30-2005, 08:26 PM
:help can v get zoom view and sroll view also???

BUT REQUIRED THE OUTPUT IF ONLY SHEET IS SELECTED.