Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 41
Default How to use selection change instead of double click event?

Hi,
I am using the following code to autofilter a list if the user wants to see
more details of employee training. The problem is, if I want to see more
details I have to double click first on employee ID and click on a link
beside employee ID. What I want is, once I click on the link, the link takes
me to the sheet of training and filter employee ID and training of him. How
to adjust the blow code?
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Dim cell As Range
Sheets("a1").Rows.EntireRow.Interior.ColorIndex = xlNone
Sheets("a1").Rows.EntireRow.Hidden = False
If Target.Column < 2 Then Exit Sub
For Each cell In Sheets("a1").Range("a2:a200")
If cell.Value = ActiveCell.Value Then
cell.EntireRow.Interior.ColorIndex = 6
Else
cell.EntireRow.Hidden = True
Cells(1, 1).EntireRow.Hidden = False
End If
Next cell
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6,582
Default How to use selection change instead of double click event?

I don't really understand your description of the problem. But did you try
putting the code into the following?

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

End Sub


- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______


"ghost" wrote in message
...
Hi,
I am using the following code to autofilter a list if the user wants to
see
more details of employee training. The problem is, if I want to see more
details I have to double click first on employee ID and click on a link
beside employee ID. What I want is, once I click on the link, the link
takes
me to the sheet of training and filter employee ID and training of him.
How
to adjust the blow code?
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Dim cell As Range
Sheets("a1").Rows.EntireRow.Interior.ColorIndex = xlNone
Sheets("a1").Rows.EntireRow.Hidden = False
If Target.Column < 2 Then Exit Sub
For Each cell In Sheets("a1").Range("a2:a200")
If cell.Value = ActiveCell.Value Then
cell.EntireRow.Interior.ColorIndex = 6
Else
cell.EntireRow.Hidden = True
Cells(1, 1).EntireRow.Hidden = False
End If
Next cell
End Sub



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 change display format - double click for precedent cells? Hazel Excel Discussion (Misc queries) 0 August 26th 08 12:16 PM
How to change syperlink from single click to double click syperlinker Excel Worksheet Functions 0 June 13th 08 05:01 PM
Is there a double click event for cell? Ayo Excel Discussion (Misc queries) 3 June 6th 08 12:18 AM
How to change action of double-click left mouse button? MouseControl Excel Discussion (Misc queries) 1 September 10th 07 11:50 PM
Zip + 4 format column then must double click to change - why? dm Excel Discussion (Misc queries) 4 September 12th 06 06:01 PM


All times are GMT +1. The time now is 10:42 AM.

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"