View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
richardreye[_2_] richardreye[_2_] is offline
external usenet poster
 
Posts: 1
Default dynamic hyperlink or onclick event


I would use the following code for a doubleclick event

Right-click on the 'Main Page' tab and select code. Paste the
following

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)

Sheets("1st Query").Select
Selection.AutoFilter Field:=1, Criteria1:=Target.Value

End Sub

Select the '1st Query' sheet in the VB Editor and paste this code

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)

Sheets("2nd Query").Select
Selection.AutoFilter Field:=1, Criteria1:=Target.Value

End Sub

This assumes that either the title or data is in A1 for each query tab.
All a user now needs to do is double-click on the data to be filtered by
the next query. YOU may want to add some error checking but this should
get you started.

HTH


--
richardreye
------------------------------------------------------------------------
richardreye's Profile: http://www.excelforum.com/member.php...o&userid=14103
View this thread: http://www.excelforum.com/showthread...hreadid=345743