Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Paste a hyperlink

I have a the full name of a file in a string variable. I need example code on
how to paste it into a cell as a hyperlink, so that if it is clicked the file
will open in its native format (i.e. Excel in Excel, Word in Word, etc.).

I tried to record it, but that doesn't work. Can somone please help me out?

Thanks much in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Paste a hyperlink

quartz

Try this


Sub test()

Dim sVar As String

sVar = "c:\book1.xls"

With Sheet1.Range("A1")
.Hyperlinks.Add .Cells(1, 1), sVar
End With

End Sub


--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com

quartz wrote:
I have a the full name of a file in a string variable. I need example
code on how to paste it into a cell as a hyperlink, so that if it is
clicked the file will open in its native format (i.e. Excel in Excel,
Word in Word, etc.).

I tried to record it, but that doesn't work. Can somone please help
me out?

Thanks much in advance.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Paste a hyperlink if cell contains XXXX...

Partly answers my dilemma. I have a form with 20 lines that uses a macro to
paste into a database. In Cell D18 it can be either text or a hyperlink.
Problem is that the macro pastes the hyperlink in D18 to DBase as text
instead of the link. 1) how do you add the IF THEN to determine if the text
is actual hyperlink and then paste it as such, or 2) if I make the cell only
available for hyperlinks, how to get it copied to DBase if cell has link in
it, or if cell is blank? thanx 4 this great service. tom dollardoc

"Dick Kusleika" wrote in message
...
quartz
Try this
Sub test()
Dim sVar As String
sVar = "c:\book1.xls"
With Sheet1.Range("A1")

.Hyperlinks.Add .Cells(1, 1), sVar 'Does this format cell a
Hyperlink?'
End With

End Sub
--

Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com

quartz wrote:
I have a the full name of a file in a string variable. I need example
code on how to paste it into a cell as a hyperlink, so that if it is
clicked the file will open in its native format (i.e. Excel in Excel,
Word in Word, etc.).

I tried to record it, but that doesn't work. Can somone please help
me out?

Thanks much in advance.





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Paste a hyperlink if cell contains XXXX...

Tom

Are you talking about Dbase the database program? I have no idea how to
paste into dbase so it's a hyperlink. How are you pasting in there as text
now?

--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com

dollardoc wrote:
Partly answers my dilemma. I have a form with 20 lines that uses a
macro to paste into a database. In Cell D18 it can be either text or
a hyperlink. Problem is that the macro pastes the hyperlink in D18 to
DBase as text instead of the link. 1) how do you add the IF THEN to
determine if the text is actual hyperlink and then paste it as such,
or 2) if I make the cell only available for hyperlinks, how to get it
copied to DBase if cell has link in it, or if cell is blank? thanx 4
this great service. tom dollardoc
"Dick Kusleika" wrote in message
...
quartz
Try this
Sub test()
Dim sVar As String
sVar = "c:\book1.xls"
With Sheet1.Range("A1")

.Hyperlinks.Add .Cells(1, 1), sVar 'Does this format cell a
Hyperlink?'
End With

End Sub
--

Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com

quartz wrote:
I have a the full name of a file in a string variable. I need
example code on how to paste it into a cell as a hyperlink, so that
if it is clicked the file will open in its native format (i.e.
Excel in Excel, Word in Word, etc.).

I tried to record it, but that doesn't work. Can somone please help
me out?

Thanks much in advance.



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
Hyperlink Copy & Paste Lise Excel Discussion (Misc queries) 0 November 18th 08 03:28 AM
Hyperlink to paste in other location obiwootenubi Links and Linking in Excel 0 August 30th 06 05:22 AM
hyperlink copy / paste Benjamin Excel Discussion (Misc queries) 1 November 2nd 05 03:46 PM
How do I get a hyperlink to track cut and paste data? Kev Nurse Excel Discussion (Misc queries) 2 February 2nd 05 11:40 PM


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