View Single Post
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default Common Private Sub

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Range)
If Target.Address = "$G$8" Then
Range("C9").Select
ElseIf Target.Address = "$D$32" Then
Range("I3").Select
End If
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



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Booker" wrote in message
...
I have 25 same sheets and in everyone is included same Private Sub for

cursor
movement.

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Target.Address = "$G$8" Then
Range("C9").Select
End If
.
.
.
If Target.Address = "$D$32" Then
Range("I3").Select
End If
End Sub

How can I use this macro as one for all sheets to reduce size of file.

Thanks in advance.