Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Paste Hyperlink result as working hyperlink | Excel Worksheet Functions | |||
Hyperlink Copy & Paste | Excel Discussion (Misc queries) | |||
Hyperlink to paste in other location | Links and Linking in Excel | |||
hyperlink copy / paste | Excel Discussion (Misc queries) | |||
How do I get a hyperlink to track cut and paste data? | Excel Discussion (Misc queries) |