Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I reviewed all of the related subjects but could not achieve to solve my link problem. My problem is, I have a cell Q5 on the master sheet, that calculates a link string. Its value changes based on my selections in the sheet. For ref. let's assume the value in Q5 is "Alisan!$H$2" without double-quotes. I've created a button to use jumping to the sheet-cell that is determined by the Q5 value. But neither .Activate, nor .FollowHyperlink rows below worked. Can somebody help me and tell me where I fail? Sub Button124_Click() a = Range("Q5").Value Range(a).Activate 'or ActiveWorkbook.FollowHyperlink Address:=a, NewWindow:=False End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You must first select the sheet and then you can select the range. You can
not do it all in one shot. Something like this... Private Sub Button124_Click() Dim strAddress As String strAddress = Range("Q5").Value Sheets(Replace(Left(strAddress, InStr(strAddress, "!") - 1), "'", "")).Select ActiveSheet.Range(Trim(Mid(strAddress, InStr(strAddress, "!") + 1, 256))).Select End Sub -- HTH... Jim Thomlinson "PalyanJoe" wrote: Hi, I reviewed all of the related subjects but could not achieve to solve my link problem. My problem is, I have a cell Q5 on the master sheet, that calculates a link string. Its value changes based on my selections in the sheet. For ref. let's assume the value in Q5 is "Alisan!$H$2" without double-quotes. I've created a button to use jumping to the sheet-cell that is determined by the Q5 value. But neither .Activate, nor .FollowHyperlink rows below worked. Can somebody help me and tell me where I fail? Sub Button124_Click() a = Range("Q5").Value Range(a).Activate 'or ActiveWorkbook.FollowHyperlink Address:=a, NewWindow:=False End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you Jim. Your code worked well as well. Now I will work on my code
based on your coding techniques. "Jim Thomlinson": You must first select the sheet and then you can select the range. You can not do it all in one shot. Something like this... Private Sub Button124_Click() Dim strAddress As String strAddress = Range("Q5").Value Sheets(Replace(Left(strAddress, InStr(strAddress, "!") - 1), "'", "")).Select ActiveSheet.Range(Trim(Mid(strAddress, InStr(strAddress, "!") + 1, 256))).Select End Sub -- HTH... Jim Thomlinson "PalyanJoe" wrote: Hi, I reviewed all of the related subjects but could not achieve to solve my link problem. My problem is, I have a cell Q5 on the master sheet, that calculates a link string. Its value changes based on my selections in the sheet. For ref. let's assume the value in Q5 is "Alisan!$H$2" without double-quotes. I've created a button to use jumping to the sheet-cell that is determined by the Q5 value. But neither .Activate, nor .FollowHyperlink rows below worked. Can somebody help me and tell me where I fail? Sub Button124_Click() a = Range("Q5").Value Range(a).Activate 'or ActiveWorkbook.FollowHyperlink Address:=a, NewWindow:=False End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub Button124_Click()
Dim a as String, rng as Range a = Range("Q5").Value set rng = Application.Evaluate(a) Application.Goto rng, True End Sub -- Regards, Tom Ogilvy "PalyanJoe" wrote: Hi, I reviewed all of the related subjects but could not achieve to solve my link problem. My problem is, I have a cell Q5 on the master sheet, that calculates a link string. Its value changes based on my selections in the sheet. For ref. let's assume the value in Q5 is "Alisan!$H$2" without double-quotes. I've created a button to use jumping to the sheet-cell that is determined by the Q5 value. But neither .Activate, nor .FollowHyperlink rows below worked. Can somebody help me and tell me where I fail? Sub Button124_Click() a = Range("Q5").Value Range(a).Activate 'or ActiveWorkbook.FollowHyperlink Address:=a, NewWindow:=False End Sub |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm very lucky, my programming god helped me. You are the guru, Tom.
Your code did what I want. Thank you very much. "Tom Ogilvy": Sub Button124_Click() Dim a as String, rng as Range a = Range("Q5").Value set rng = Application.Evaluate(a) Application.Goto rng, True End Sub -- Regards, Tom Ogilvy "PalyanJoe" wrote: Hi, I reviewed all of the related subjects but could not achieve to solve my link problem. My problem is, I have a cell Q5 on the master sheet, that calculates a link string. Its value changes based on my selections in the sheet. For ref. let's assume the value in Q5 is "Alisan!$H$2" without double-quotes. I've created a button to use jumping to the sheet-cell that is determined by the Q5 value. But neither .Activate, nor .FollowHyperlink rows below worked. Can somebody help me and tell me where I fail? Sub Button124_Click() a = Range("Q5").Value Range(a).Activate 'or ActiveWorkbook.FollowHyperlink Address:=a, NewWindow:=False End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Not able to Click Button placed in the Work Sheet | Excel Worksheet Functions | |||
cannot click button on sheet | Excel Programming | |||
Code for opening another sheet on button click | Excel Programming | |||
How do I create a command button to jump from sheet to sheet in a. | Excel Worksheet Functions | |||
is it possible to jump to the souce of link in sheet with mosue click?? | Excel Programming |