View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bill Kuunders Bill Kuunders is offline
external usenet poster
 
Posts: 303
Default go to a particular sheet Gord Dibben

Eva,
Thanks.
We have a rather large network, and it seems to be too difficult to find
the workbook via a hyperlink.
I would like to write a macro to open the workbook and find the sheet where
cell A3 has the same value as the cell I double klicked on the original
sheet.

I have problems shifting the focus from the original to the newly openend
book.
Something to do with the target in the before double click event?

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

Const WS_RANGE As String = "E1:E2000"
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
Workbooks.Open Filename:="C:\Documents and Settings\Bill\My
Documents\dummybatch.xls"

'ActiveWorkbook.Sheets(Target.Value).Activate
THIS WAS Gord Dibbens solution to find the tab name....
I WOULD LIKE to check each sheet in the dummybatch workbook

Workbooks("dummybatch.xls").Activate
Worksheets(3).Select
Range("A3").Activate
I JUST CAN'T get the above step to work
The Range A3 value does not change from the original workbook to the newly
opened book / sheet /a3 value
and for the stuff below ....I'm guessing a bit

For Each Sheet In Sheets
Range("A3").Select
If Target.Value = Range("A3").Value Then Sheet.Activate

Next

End If
End Sub

"Eva" wrote in message
...
Insert/Hyperlink/ and then choose from Look in the spreadsheet and then
type
the sheet name and cell addres
example
C:\Book1.xls\Sheet1!A1
Click yes if helped


Eva


"Bill Kuunders" wrote:

is there a way to hyperlink from one workbook to a specific worksheet in
another workbook.



Gord Dibben had this as a solution which works fine.

Private Sub Worksheet_BeforeDoubleClick(ByVal _
Target As Range, Cancel As Boolean)
Const WS_RANGE As String = "A1:A80"
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
Workbooks.Open Filename:= _
"C:\Program Files\Microsoft Office\Exceldata\Book1.xls"
ActiveWorkbook.Sheets(Target.Value).Activate
End If
End Sub



Gord,
Would there be a way I can look for a value say in cell C2 on each sheet
rather than the tab name.

Thanks
Bill Kuunders NZ


.