PC Review


Reply
Thread Tools Rate Thread

Button-click to jump another sheet

 
 
=?Utf-8?B?UGFseWFuSm9l?=
Guest
Posts: n/a
 
      30th May 2007
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 With Quote
 
 
 
 
=?Utf-8?B?SmltIFRob21saW5zb24=?=
Guest
Posts: n/a
 
      30th May 2007
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

 
Reply With Quote
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      30th May 2007
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 With Quote
 
=?Utf-8?B?UGFseWFuSm9l?=
Guest
Posts: n/a
 
      31st May 2007
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 With Quote
 
=?Utf-8?B?UGFseWFuSm9l?=
Guest
Posts: n/a
 
      31st May 2007
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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Not able to Click Button placed in the Work Sheet Seetharaman Microsoft Excel Worksheet Functions 1 29th Jan 2009 01:23 PM
cannot click button on sheet =?Utf-8?B?QXJub2xkIEtsYXBoZWNr?= Microsoft Excel Programming 4 21st Sep 2006 07:11 PM
Code for opening another sheet on button click =?Utf-8?B?cG11ZA==?= Microsoft Excel Programming 5 18th May 2005 10:33 PM
How do I create a command button to jump from sheet to sheet in a. =?Utf-8?B?RGFybGVuZXc=?= Microsoft Excel Worksheet Functions 3 22nd Mar 2005 10:36 PM
is it possible to jump to the souce of link in sheet with mosue click?? John Wirt Microsoft Excel Programming 3 27th Nov 2003 02:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:32 PM.