Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 160
Default Trigger Code with Mouse Click

In this code, when the user highlights or mouse clicks on a trigger cell in the Scorecard worksheet, they are moved to one of four other worksheets, according to the schedule. Is there a way to restrict triggering this code to a mouse click only eliminates triggering by simply arrowing to the trigger cell

Sub Worksheet_SelectionChange(ByVal Target As Excel.Range
Dim v(1 To 16, 1 To 3) As Strin
Dim rng1 As Rang
Dim i As Lon

v(1, 1) = "C12": v(1, 2) = "Customer": v(1, 3) = "A1
v(2, 1) = "E17": v(2, 2) = "Customer": v(2, 3) = "A1
v(3, 1) = "E20": v(3, 2) = "Customer": v(3, 3) = "A33
v(4, 1) = "E23": v(4, 2) = "Customer": v(4, 3) = "A65
v(5, 1) = "C30": v(5, 2) = "Financial": v(5, 3) = "A1
v(6, 1) = "E35": v(6, 2) = "Financial": v(6, 3) = "A1
v(7, 1) = "E38": v(7, 2) = "Financial": v(7, 3) = "A33
v(8, 1) = "E41": v(8, 2) = "Financial": v(8, 3) = "A65
v(9, 1) = "AC12": v(9, 2) = "Learning and Growth": v(9, 3) = "A1
v(10, 1) = "AE17": v(10, 2) = "Learning and Growth": v(10, 3) = "A1
v(11, 1) = "AE20": v(11, 2) = "Learning and Growth": v(11, 3) = "A33
v(12, 1) = "AE23": v(12, 2) = "Learning and Growth": v(12, 3) = "A65
v(13, 1) = "AC30": v(13, 2) = "Internal Business Process": v(13, 3) = "A1
v(14, 1) = "AE35": v(14, 2) = "Internal Business Process": v(14, 3) = "A1
v(15, 1) = "AE38": v(15, 2) = "Internal Business Process": v(15, 3) = "A33
v(16, 1) = "AE41": v(16, 2) = "Internal Business Process": v(16, 3) = "A65

For i = 1 To 1
If Target.Address = Range(v(i, 1)).MergeArea.Address The
Application.ScreenUpdating = Fals
Set rng1 = Sheets(v(i, 2)).Range(v(i, 3)
Sheets(v(i, 2)).Selec
rng1.Selec
ActiveWindow.Zoom = 6
ActiveWindow.ScrollRow = rng1.ro
ActiveWindow.ScrollColumn = rng1.Colum
Application.ScreenUpdating = Tru
Exit Fo
End I
Nex
End Su

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Trigger Code with Mouse Click

I think it's going to be tough to figure out how a range was selected. I
might be inclined to have users double-click a cell, and then use the
Worksheet_BeforeDoubleClick event.

Btw, it might be more efficient to make your array a public variable and
populate it just once, say during the Workbook_Open event, rather than every
time a cell is selected.

--
Jim Rech
Excel MVP


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
Trigger or code Curt Excel Discussion (Misc queries) 0 April 20th 07 03:32 PM
Trigger code if certian data is present Jim G Excel Discussion (Misc queries) 2 April 20th 07 09:46 AM
Each Click of the Mouse D.Parker Excel Discussion (Misc queries) 13 April 28th 05 11:24 PM
Trigger code Bourbon[_21_] Excel Programming 5 January 26th 04 04:06 PM
How to code a timer to trigger a sub-routine ? Joseph[_10_] Excel Programming 1 December 18th 03 12:48 PM


All times are GMT +1. The time now is 06:48 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"