Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Hyperlinks from one excel sheet to another in VBA

I am trying to programmatically insert a hyperlink into a cell on
sheetA (static name) from various other workbooks whose names all
differ. I want to be able to open the referenced sheets from a master
sheet. I tried to record a macro that copies and pastes as a link, but
it does not record the paste link function. Since the sheet names are
all variables except for the master, I know somewhere I need a cell
reference. i.e. Cell("filename"), but I need this to run inside a VBA
macro. Can anyone help me on this code?

Thanks in advance!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Hyperlinks from one excel sheet to another in VBA

Try something like this:

Sub hyper_put()
Dim s As String, t As String
s = Chr(34)
t = "=HYPERLINK(" & s
t = t & "file:///C:\Documents and Settings\Owner\Desktop\Book2.xls#Sheet2!B9"
t = t & s & ")"
Range("A1").Value = t
End Sub

The contents of A1 will be:

=HYPERLINK("file:///C:\Documents and
Settings\Owner\Desktop\Book2.xls#Sheet2!B9")


--
Gary''s Student - gsnu200738


"Lindleman" wrote:

I am trying to programmatically insert a hyperlink into a cell on
sheetA (static name) from various other workbooks whose names all
differ. I want to be able to open the referenced sheets from a master
sheet. I tried to record a macro that copies and pastes as a link, but
it does not record the paste link function. Since the sheet names are
all variables except for the master, I know somewhere I need a cell
reference. i.e. Cell("filename"), but I need this to run inside a VBA
macro. Can anyone help me on this code?

Thanks in advance!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Hyperlinks from one excel sheet to another in VBA

On Aug 16, 10:36 pm, Lindleman wrote:
I am trying to programmatically insert a hyperlink into a cell on
sheetA (static name) from various other workbooks whose names all
differ. I want to be able to open the referenced sheets from a master
sheet. I tried to record a macro that copies and pastes as a link, but
it does not record the paste link function. Since the sheet names are
all variables except for the master, I know somewhere I need a cell
reference. i.e. Cell("filename"), but I need this to run inside a VBA
macro. Can anyone help me on this code?

Thanks in advance!


Can anyone help me?

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
How do I temporarily disable hyperlinks in an excel sheet? looloof Setting up and Configuration of Excel 1 December 2nd 07 01:47 PM
Update 2000 Excel hyperlinks to 2003 hyperlinks lonv155 Excel Worksheet Functions 4 October 25th 07 05:51 AM
Excel Hyperlinks- cell content v. hyperlinks herpetafauna Excel Discussion (Misc queries) 2 May 23rd 06 04:39 AM
delete hyperlinks from graphical objects in excel sheet v_gyku[_2_] Excel Programming 7 September 27th 05 06:03 AM
Not able to open hyperlinks from Excel sheet Shilps Setting up and Configuration of Excel 1 July 21st 05 08:02 AM


All times are GMT +1. The time now is 07:46 PM.

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"