Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default add hyperlink using sheet names and cells(i,j)

Hello,

I have these two routines. They are supposed to do the same. For some reason, the Y routine gives me an error.
Please advise

Thank you
Tuli


Public Sub X()
Sheets("Sheet1").Hyperlinks.Add Anchor:=Sheets("sheet1").Cells(1, 2), Address:="", SubAddress:= _
"'sheet2'!A1", TextToDisplay:="Back <<"
End Sub

Public Sub Y()

Sheets("Sheet1").Hyperlinks.Add Anchor:=Sheets("sheet1").Cells(1, 2), Address:="", SubAddress:= _
Sheets("sheet2").Cells(2, 1), TextToDisplay:="Back <<"
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default add hyperlink using sheet names and cells(i,j)

Hi,

Am Tue, 31 Dec 2013 12:30:17 -0800 (PST) schrieb tuli:

Public Sub X()
Sheets("Sheet1").Hyperlinks.Add Anchor:=Sheets("sheet1").Cells(1, 2), Address:="", SubAddress:= _
"'sheet2'!A1", TextToDisplay:="Back <<"
End Sub

Public Sub Y()

Sheets("Sheet1").Hyperlinks.Add Anchor:=Sheets("sheet1").Cells(1, 2), Address:="", SubAddress:= _
Sheets("sheet2").Cells(2, 1), TextToDisplay:="Back <<"
End Sub


Address and Subaddress have to be strings and not objects.


Regards
Claus B.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default add hyperlink using sheet names and cells(i,j)

thanks,

Any ideas on how do do it?


On Tuesday, December 31, 2013 3:30:17 PM UTC-5, tuli wrote:
Hello,



I have these two routines. They are supposed to do the same. For some reason, the Y routine gives me an error.

Please advise



Thank you

Tuli





Public Sub X()

Sheets("Sheet1").Hyperlinks.Add Anchor:=Sheets("sheet1").Cells(1, 2), Address:="", SubAddress:= _

"'sheet2'!A1", TextToDisplay:="Back <<"

End Sub



Public Sub Y()



Sheets("Sheet1").Hyperlinks.Add Anchor:=Sheets("sheet1").Cells(1, 2), Address:="", SubAddress:= _

Sheets("sheet2").Cells(2, 1), TextToDisplay:="Back <<"

End Sub


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default add hyperlink using sheet names and cells(i,j)

Hi,

Am Tue, 31 Dec 2013 13:11:31 -0800 (PST) schrieb tuli:

Any ideas on how do do it?


the way you did it in macro "X" is the best way to do it.
But you can also try:
SubAddress:= "Sheet2!" & Cells(2, 1).Address(0,0)


Regards
Claus B.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
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
Named sheet to change Cells names Skrapik New Users to Excel 3 August 11th 07 04:46 AM
hyperlink to sheet name where sheet names=cell content Banzai Excel Programming 1 August 6th 07 12:46 PM
Use a hyperlink to display a selection of cells on another sheet (in same workbook) Mikey C Excel Discussion (Misc queries) 1 March 29th 07 11:44 AM
populating cells with sheet names bjrbrain Excel Programming 5 May 5th 06 07:14 AM
Linking sheet tab names to cells Frank Kabel Excel Programming 6 April 7th 04 11:57 PM


All times are GMT +1. The time now is 05:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"