Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 303
Default go to a particular sheet Gord Dibben

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


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Eva Eva is offline
external usenet poster
 
Posts: 197
Default go to a particular sheet Gord Dibben

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


.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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


.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default go to a particular sheet Gord Dibben

Bill

Private Sub Worksheet_BeforeDoubleClick(ByVal Target _
As Range, Cancel As Boolean)
Const WS_RANGE As String = "E1:E2000"
Dim ws As Worksheet
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
On Error GoTo endit
Application.EnableEvents = False
Workbooks.Open Filename:="C:\Documents and Settings\Bill\My" & _
"Documents\dummybatch.xls"
For Each ws In ActiveWorkbook.Sheets
If ws.Range("A3").Value = Target.Value Then
ws.Activate
End If
Next
End If
endit:
Cancel = True
Application.EnableEvents = True
End Sub

If there is a tie in dummybatch.xls sheets A3 value then last sheet with the
value is activated.

Do you really have 2000 sheets in dummybatch.xls?

Else why have a range of E1:E2000 to choose a value from?


Gord

On Sun, 15 Nov 2009 10:40:56 +1300, "Bill Kuunders"
wrote:

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


.



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 303
Default go to a particular sheet Gord Dibben

Thank you Lord. :):)

It works .....!!!!

Testing seems to indicate that the E1:E2000
refers to the number of rows in the original spreadsheet. The one where I
double click somewhere in that range.
I still can't find the right instruction to select a certain cell on the
selected sheet in dummybatch but that doesn't really matter.
At least the right sheet opens up

Thanks heaps Gord
Bill Kuunders
Greetings from Newe Zealand

"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
Bill

Private Sub Worksheet_BeforeDoubleClick(ByVal Target _
As Range, Cancel As Boolean)
Const WS_RANGE As String = "E1:E2000"
Dim ws As Worksheet
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
On Error GoTo endit
Application.EnableEvents = False
Workbooks.Open Filename:="C:\Documents and Settings\Bill\My" & _
"Documents\dummybatch.xls"
For Each ws In ActiveWorkbook.Sheets
If ws.Range("A3").Value = Target.Value Then
ws.Activate
End If
Next
End If
endit:
Cancel = True
Application.EnableEvents = True
End Sub

If there is a tie in dummybatch.xls sheets A3 value then last sheet with
the
value is activated.

Do you really have 2000 sheets in dummybatch.xls?

Else why have a range of E1:E2000 to choose a value from?


Gord

On Sun, 15 Nov 2009 10:40:56 +1300, "Bill Kuunders"
wrote:

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


.







  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default go to a particular sheet Gord Dibben

Bill

Which cell do you want to select when ws.Activate has selected the sheet
with the value in A3?


Gord

On Sun, 15 Nov 2009 14:59:04 +1300, "Bill Kuunders"
wrote:

Thank you Lord. :):)

It works .....!!!!

Testing seems to indicate that the E1:E2000
refers to the number of rows in the original spreadsheet. The one where I
double click somewhere in that range.
I still can't find the right instruction to select a certain cell on the
selected sheet in dummybatch but that doesn't really matter.
At least the right sheet opens up

Thanks heaps Gord
Bill Kuunders
Greetings from Newe Zealand

"Gord Dibben" <gorddibbATshawDOTca wrote in message
.. .
Bill

Private Sub Worksheet_BeforeDoubleClick(ByVal Target _
As Range, Cancel As Boolean)
Const WS_RANGE As String = "E1:E2000"
Dim ws As Worksheet
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
On Error GoTo endit
Application.EnableEvents = False
Workbooks.Open Filename:="C:\Documents and Settings\Bill\My" & _
"Documents\dummybatch.xls"
For Each ws In ActiveWorkbook.Sheets
If ws.Range("A3").Value = Target.Value Then
ws.Activate
End If
Next
End If
endit:
Cancel = True
Application.EnableEvents = True
End Sub

If there is a tie in dummybatch.xls sheets A3 value then last sheet with
the
value is activated.

Do you really have 2000 sheets in dummybatch.xls?

Else why have a range of E1:E2000 to choose a value from?


Gord

On Sun, 15 Nov 2009 10:40:56 +1300, "Bill Kuunders"
wrote:

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


.





  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 303
Default go to a particular sheet Gord Dibben

I was interested to find out why I can't.
I would like to show cell A3 as the active cell when the sheet is opened.

Thanks

"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
Bill

Which cell do you want to select when ws.Activate has selected the sheet
with the value in A3?


Gord

On Sun, 15 Nov 2009 14:59:04 +1300, "Bill Kuunders"
wrote:

Thank you Lord. :):)

It works .....!!!!

Testing seems to indicate that the E1:E2000
refers to the number of rows in the original spreadsheet. The one where I
double click somewhere in that range.
I still can't find the right instruction to select a certain cell on the
selected sheet in dummybatch but that doesn't really matter.
At least the right sheet opens up

Thanks heaps Gord
Bill Kuunders
Greetings from Newe Zealand

"Gord Dibben" <gorddibbATshawDOTca wrote in message
. ..
Bill

Private Sub Worksheet_BeforeDoubleClick(ByVal Target _
As Range, Cancel As Boolean)
Const WS_RANGE As String = "E1:E2000"
Dim ws As Worksheet
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
On Error GoTo endit
Application.EnableEvents = False
Workbooks.Open Filename:="C:\Documents and Settings\Bill\My" & _
"Documents\dummybatch.xls"
For Each ws In ActiveWorkbook.Sheets
If ws.Range("A3").Value = Target.Value Then
ws.Activate
End If
Next
End If
endit:
Cancel = True
Application.EnableEvents = True
End Sub

If there is a tie in dummybatch.xls sheets A3 value then last sheet with
the
value is activated.

Do you really have 2000 sheets in dummybatch.xls?

Else why have a range of E1:E2000 to choose a value from?


Gord

On Sun, 15 Nov 2009 10:40:56 +1300, "Bill Kuunders"
wrote:

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


.







  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default go to a particular sheet Gord Dibben

ws.Activate
Range("A3").select


Gord


On Mon, 16 Nov 2009 09:37:02 +1300, "Bill Kuunders"
wrote:

I was interested to find out why I can't.
I would like to show cell A3 as the active cell when the sheet is opened.

Thanks

"Gord Dibben" <gorddibbATshawDOTca wrote in message
.. .
Bill

Which cell do you want to select when ws.Activate has selected the sheet
with the value in A3?


Gord

On Sun, 15 Nov 2009 14:59:04 +1300, "Bill Kuunders"
wrote:

Thank you Lord. :):)

It works .....!!!!

Testing seems to indicate that the E1:E2000
refers to the number of rows in the original spreadsheet. The one where I
double click somewhere in that range.
I still can't find the right instruction to select a certain cell on the
selected sheet in dummybatch but that doesn't really matter.
At least the right sheet opens up

Thanks heaps Gord
Bill Kuunders
Greetings from Newe Zealand

"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
Bill

Private Sub Worksheet_BeforeDoubleClick(ByVal Target _
As Range, Cancel As Boolean)
Const WS_RANGE As String = "E1:E2000"
Dim ws As Worksheet
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
On Error GoTo endit
Application.EnableEvents = False
Workbooks.Open Filename:="C:\Documents and Settings\Bill\My" & _
"Documents\dummybatch.xls"
For Each ws In ActiveWorkbook.Sheets
If ws.Range("A3").Value = Target.Value Then
ws.Activate
End If
Next
End If
endit:
Cancel = True
Application.EnableEvents = True
End Sub

If there is a tie in dummybatch.xls sheets A3 value then last sheet with
the
value is activated.

Do you really have 2000 sheets in dummybatch.xls?

Else why have a range of E1:E2000 to choose a value from?


Gord

On Sun, 15 Nov 2009 10:40:56 +1300, "Bill Kuunders"
wrote:

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


.







  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 303
Default go to a particular sheet Gord Dibben

It doesn't want to do it.
Obviously I can get the same result if I introduce a "before close"
instruction.
Just interested to see why Range("A3").select
does not work.

Thanks Gord


"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
ws.Activate
Range("A3").select


Gord


On Mon, 16 Nov 2009 09:37:02 +1300, "Bill Kuunders"
wrote:

I was interested to find out why I can't.
I would like to show cell A3 as the active cell when the sheet is opened.

Thanks

"Gord Dibben" <gorddibbATshawDOTca wrote in message
. ..
Bill

Which cell do you want to select when ws.Activate has selected the sheet
with the value in A3?


Gord

On Sun, 15 Nov 2009 14:59:04 +1300, "Bill Kuunders"
wrote:

Thank you Lord. :):)

It works .....!!!!

Testing seems to indicate that the E1:E2000
refers to the number of rows in the original spreadsheet. The one where
I
double click somewhere in that range.
I still can't find the right instruction to select a certain cell on the
selected sheet in dummybatch but that doesn't really matter.
At least the right sheet opens up

Thanks heaps Gord
Bill Kuunders
Greetings from Newe Zealand

"Gord Dibben" <gorddibbATshawDOTca wrote in message
m...
Bill

Private Sub Worksheet_BeforeDoubleClick(ByVal Target _
As Range, Cancel As Boolean)
Const WS_RANGE As String = "E1:E2000"
Dim ws As Worksheet
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
On Error GoTo endit
Application.EnableEvents = False
Workbooks.Open Filename:="C:\Documents and Settings\Bill\My" & _
"Documents\dummybatch.xls"
For Each ws In ActiveWorkbook.Sheets
If ws.Range("A3").Value = Target.Value Then
ws.Activate
End If
Next
End If
endit:
Cancel = True
Application.EnableEvents = True
End Sub

If there is a tie in dummybatch.xls sheets A3 value then last sheet
with
the
value is activated.

Do you really have 2000 sheets in dummybatch.xls?

Else why have a range of E1:E2000 to choose a value from?


Gord

On Sun, 15 Nov 2009 10:40:56 +1300, "Bill Kuunders"
wrote:

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


.









  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default go to a particular sheet Gord Dibben

Because I did not qualify the sheet reference. Apologies for not testing.

Either of these are OK

ws.Range("A3").select

or

If ws.Range("A3").Value = Target.Value Then
With ws
.Activate
.Range("A3").Select
End With
End If


Gord

On Mon, 16 Nov 2009 10:13:57 +1300, "Bill Kuunders"
wrote:

It doesn't want to do it.
Obviously I can get the same result if I introduce a "before close"
instruction.
Just interested to see why Range("A3").select
does not work.

Thanks Gord


"Gord Dibben" <gorddibbATshawDOTca wrote in message
.. .
ws.Activate
Range("A3").select


Gord


On Mon, 16 Nov 2009 09:37:02 +1300, "Bill Kuunders"
wrote:

I was interested to find out why I can't.
I would like to show cell A3 as the active cell when the sheet is opened.

Thanks

"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
Bill

Which cell do you want to select when ws.Activate has selected the sheet
with the value in A3?


Gord

On Sun, 15 Nov 2009 14:59:04 +1300, "Bill Kuunders"
wrote:

Thank you Lord. :):)

It works .....!!!!

Testing seems to indicate that the E1:E2000
refers to the number of rows in the original spreadsheet. The one where
I
double click somewhere in that range.
I still can't find the right instruction to select a certain cell on the
selected sheet in dummybatch but that doesn't really matter.
At least the right sheet opens up

Thanks heaps Gord
Bill Kuunders
Greetings from Newe Zealand

"Gord Dibben" <gorddibbATshawDOTca wrote in message
om...
Bill

Private Sub Worksheet_BeforeDoubleClick(ByVal Target _
As Range, Cancel As Boolean)
Const WS_RANGE As String = "E1:E2000"
Dim ws As Worksheet
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
On Error GoTo endit
Application.EnableEvents = False
Workbooks.Open Filename:="C:\Documents and Settings\Bill\My" & _
"Documents\dummybatch.xls"
For Each ws In ActiveWorkbook.Sheets
If ws.Range("A3").Value = Target.Value Then
ws.Activate
End If
Next
End If
endit:
Cancel = True
Application.EnableEvents = True
End Sub

If there is a tie in dummybatch.xls sheets A3 value then last sheet
with
the
value is activated.

Do you really have 2000 sheets in dummybatch.xls?

Else why have a range of E1:E2000 to choose a value from?


Gord

On Sun, 15 Nov 2009 10:40:56 +1300, "Bill Kuunders"
wrote:

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


.











  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 303
Default go to a particular sheet Gord Dibben

Well, That was soooooo obvious ....NOT

Who would have thought. Normally we don't have to do that.
Again Thanks a lot Gord

Greetings from New Zealand
Bill Kuunders

"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
Because I did not qualify the sheet reference. Apologies for not testing.

Either of these are OK

ws.Range("A3").select

or

If ws.Range("A3").Value = Target.Value Then
With ws
.Activate
.Range("A3").Select
End With
End If


Gord

On Mon, 16 Nov 2009 10:13:57 +1300, "Bill Kuunders"
wrote:

It doesn't want to do it.
Obviously I can get the same result if I introduce a "before close"
instruction.
Just interested to see why Range("A3").select
does not work.

Thanks Gord


"Gord Dibben" <gorddibbATshawDOTca wrote in message
. ..
ws.Activate
Range("A3").select


Gord


On Mon, 16 Nov 2009 09:37:02 +1300, "Bill Kuunders"
wrote:

I was interested to find out why I can't.
I would like to show cell A3 as the active cell when the sheet is
opened.

Thanks

"Gord Dibben" <gorddibbATshawDOTca wrote in message
m...
Bill

Which cell do you want to select when ws.Activate has selected the
sheet
with the value in A3?


Gord

On Sun, 15 Nov 2009 14:59:04 +1300, "Bill Kuunders"
wrote:

Thank you Lord. :):)

It works .....!!!!

Testing seems to indicate that the E1:E2000
refers to the number of rows in the original spreadsheet. The one
where
I
double click somewhere in that range.
I still can't find the right instruction to select a certain cell on
the
selected sheet in dummybatch but that doesn't really matter.
At least the right sheet opens up

Thanks heaps Gord
Bill Kuunders
Greetings from Newe Zealand

"Gord Dibben" <gorddibbATshawDOTca wrote in message
news:5ncuf51a84r0h83lh4s1dcobgv629fr0ju@4ax. com...
Bill

Private Sub Worksheet_BeforeDoubleClick(ByVal Target _
As Range, Cancel As Boolean)
Const WS_RANGE As String = "E1:E2000"
Dim ws As Worksheet
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
On Error GoTo endit
Application.EnableEvents = False
Workbooks.Open Filename:="C:\Documents and Settings\Bill\My" & _
"Documents\dummybatch.xls"
For Each ws In ActiveWorkbook.Sheets
If ws.Range("A3").Value = Target.Value Then
ws.Activate
End If
Next
End If
endit:
Cancel = True
Application.EnableEvents = True
End Sub

If there is a tie in dummybatch.xls sheets A3 value then last sheet
with
the
value is activated.

Do you really have 2000 sheets in dummybatch.xls?

Else why have a range of E1:E2000 to choose a value from?


Gord

On Sun, 15 Nov 2009 10:40:56 +1300, "Bill Kuunders"
wrote:

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


.











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
For Gord or other: dynamic comment andy62 Excel Discussion (Misc queries) 7 March 2nd 09 11:22 PM
Navigation Toolbar help- Gord Dibben Martin ©¿©¬ @nohere.net Excel Discussion (Misc queries) 9 January 14th 09 10:29 AM
Filter or sumproduct (Question for Gord Dibben) capt Excel Discussion (Misc queries) 4 December 10th 07 03:33 PM
Question for Gord D DaveM Excel Discussion (Misc queries) 7 November 17th 07 06:27 PM
A question for Gord Dibben Oliver Ferns via OfficeKB.com Excel Discussion (Misc queries) 1 March 4th 05 05:12 PM


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