#1   Report Post  
Booker
 
Posts: n/a
Default Common Private Sub

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.
  #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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make "common factor" formula ? toyota58 Excel Worksheet Functions 1 August 18th 05 07:53 PM
more than 3 conditions in conditional formatting - possible? rob curtis Excel Discussion (Misc queries) 11 August 17th 05 04:02 PM
date format problem Nigel Excel Discussion (Misc queries) 7 May 11th 05 12:57 PM
Numbers from seperate worksheet to common sheet S.C Excel Worksheet Functions 0 January 14th 05 02:47 AM
finding common numbers in large lists Jenn Excel Worksheet Functions 1 November 11th 04 07:42 PM


All times are GMT +1. The time now is 03:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"