#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hyperlink

Hi

I am trying to write some code to hyperlink between two worksheets..
and in the process have just about gone nuts with a syntax error I a
unable to solve.

Any suggestions would be appreciated.


b = WorksheetB
c = WorksheetC

x = 4
y = 3

b.Cells(x, 8).Formula = _
"=HYPERLINK(""#""" & "ADDRESS(ROW(" & c.Cells(y, 1).Address
"),COLUMN(" & c.Cells(y, 1).Address & "),,,MID(CELL(""filename"","
c.Cells(y, 1).Address & "),FIND(""]"",CELL(""filename""," & c.Cells(y
1).Address & "),50)))"""



Thanks in advance

Pete

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Hyperlink


Peter, try following..


If you have xl97 to worry about.. you'll have to replace
vba's REPLACE with application.substitute

Sub foo2()
Dim sFML$, b As Range, c As Range, x&, y&


sFML = "=HYPERLINK(""#""&CELL(""ADDRESS"",|RNG|)," & vbLf & _
" ""jump to "" &MID(CELL(""ADDRESS"",|RNG|),1 " & vbLf & _
" +FIND(""]"",CELL(""ADDRESS"",|RNG|)),999))"

x = 4: y = 3
Set b = Worksheets("WorksheetB").Cells(x, 8)
Set c = Worksheets("WorksheetC").Cells(y, 1)

b.Formula = Replace(sFML, "|RNG|", c.Address(external:=True))

End Sub





--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


PeterW wrote :

Hi

I am trying to write some code to hyperlink between two worksheets...
and in the process have just about gone nuts with a syntax error I am
unable to solve.

Any suggestions would be appreciated.


b = WorksheetB
c = WorksheetC

x = 4
y = 3

b.Cells(x, 8).Formula = _
"=HYPERLINK(""#""" & "ADDRESS(ROW(" & c.Cells(y, 1).Address &
"),COLUMN(" & c.Cells(y, 1).Address & "),,,MID(CELL(""filename""," &
c.Cells(y, 1).Address & "),FIND(""]"",CELL(""filename""," & c.Cells(y,
1).Address & "),50)))"""



Thanks in advance

Peter


---
Message posted from http://www.ExcelForum.com/


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hyperlink

Thanks KeepITCool ... that works wel

--
Message posted from http://www.ExcelForum.com

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
Paste Hyperlink result as working hyperlink Bod Excel Worksheet Functions 2 January 22nd 10 04:22 AM
Can't make hyperlink function work for hyperlink to website Frank B Denman Excel Worksheet Functions 15 February 5th 07 11:01 PM
Moving rows with Hyperlink doesn't move hyperlink address Samad Excel Discussion (Misc queries) 15 June 22nd 06 12:03 PM
Intra-workbook hyperlink: macro/function to return to hyperlink ce marika1981 Excel Discussion (Misc queries) 3 May 6th 05 05:47 AM
reading html when hyperlink address not hyperlink text diplayed Kevin Excel Programming 1 December 4th 03 10:13 PM


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