LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Workbook_SheetSelectionChange

in a programme visualised by me I make a selection change (in the sense I
activate a cell) in a particular sheet and fire some code. this is ok. but
subequently in the same programme I want to activate another sheet
(sh.name changes) and a cell in that sheet is activated and some other code
is fired. is it possible ?


a trivial example is given below
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Range)
'i activated sheet2 and activate a cell in that sheet
If Sh.Name = "sheet1" Then GoTo line1
If Sh.Name = "sheet2" Then GoTo line2
line1:
Range("a1") = 12345
GoTo line3
line2:
Range("a1") = 4567
line3:
End Sub

when i activate the sheet2 makes selection change in that sheet and thus
fire the code it does not go to line 2 but only goes to line1. in both the
sheets range("a1") is entered by 12345 only. perhaps I have not understood
this event procedure. .




 
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



All times are GMT +1. The time now is 02:11 AM.

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

About Us

"It's about Microsoft Excel"