Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default Hyperlink macro for personal.xls

Sub Hyperlinkcell()
'
Dim actual As Range

Set actual = Application.InputBox(Prompt:="Select cell to
hyperlink.", Type:=8)
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="",
SubAddress:=actual, TextToDisplay:=ActiveCell.Value
End Sub

Can anybody fix the above hyperlink macro pls.

Thxs

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Hyperlink macro for personal.xls

Hi Al007,

Try:

'=============
Public Hyperlinkcell()
Dim actual As Range

Set actual = Application. _
InputBox(Prompt:="Select cell to hyperlink.", _
Type:=8)
'

ActiveSheet.Hyperlinks.Add _
Anchor:=Selection, _
Address:="", _
SubAddress:=actual.Address(0, 0)
End Sub
'<<=============

---
Regards,
Norman


"al007" wrote in message
ups.com...
Sub Hyperlinkcell()
'
Dim actual As Range

Set actual = Application.InputBox(Prompt:="Select cell to
hyperlink.", Type:=8)
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="",
SubAddress:=actual, TextToDisplay:=ActiveCell.Value
End Sub

Can anybody fix the above hyperlink macro pls.

Thxs



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default Hyperlink macro for personal.xls

Thxs - but it does not work if a cell from a different sheet is
selected - can you help pls

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Hyperlink macro for personal.xls

Sub Hyperlinkcell()
'
Dim actual As Range

Set actual = Application.InputBox( _
Prompt:="Select cell to hyperlink.", Type:=8)
ActiveSheet.Hyperlinks.Add _
Anchor:=Selection, _
Address:="", _
SubAddress:="'" & actual.Parent.Name & _
"'!" & actual.Address(0, 0), _
TextToDisplay:=actual.Text
End Sub


--
Regards,
Tom Ogilvy


"al007" wrote in message
ups.com...
Sub Hyperlinkcell()
'
Dim actual As Range

Set actual = Application.InputBox(Prompt:="Select cell to
hyperlink.", Type:=8)
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="",
SubAddress:=actual, TextToDisplay:=ActiveCell.Value
End Sub

Can anybody fix the above hyperlink macro pls.

Thxs



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Hyperlink macro for personal.xls

Here is a slight revision

Sub Hyperlinkcell()
'
Dim actual As Range
Dim Act_Cell as Range
set Act_Cell = ActiveCell
Set actual = Application.InputBox( _
Prompt:="Select cell to hyperlink.", Type:=8)
ActiveSheet.Hyperlinks.Add _
Anchor:=Act_Cell, _
Address:="", _
SubAddress:="'" & actual.Parent.Name & _
"'!" & actual.Address(0, 0), _
TextToDisplay:=actual.Parent.Name & _
"!" & actual.Address(0, 0)
End Sub

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...
Sub Hyperlinkcell()
'
Dim actual As Range

Set actual = Application.InputBox( _
Prompt:="Select cell to hyperlink.", Type:=8)
ActiveSheet.Hyperlinks.Add _
Anchor:=Selection, _
Address:="", _
SubAddress:="'" & actual.Parent.Name & _
"'!" & actual.Address(0, 0), _
TextToDisplay:=actual.Text
End Sub


--
Regards,
Tom Ogilvy


"al007" wrote in message
ups.com...
Sub Hyperlinkcell()
'
Dim actual As Range

Set actual = Application.InputBox(Prompt:="Select cell to
hyperlink.", Type:=8)
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="",
SubAddress:=actual, TextToDisplay:=ActiveCell.Value
End Sub

Can anybody fix the above hyperlink macro pls.

Thxs







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default Hyperlink macro for personal.xls

Thxs tom,
Your code is working great & am using it for empty cells & using
SubAddress:=activecell.value for non empty cells with an if statement
cheers!!!



Tom Ogilvy wrote:
Here is a slight revision

Sub Hyperlinkcell()
'
Dim actual As Range
Dim Act_Cell as Range
set Act_Cell = ActiveCell
Set actual = Application.InputBox( _
Prompt:="Select cell to hyperlink.", Type:=8)
ActiveSheet.Hyperlinks.Add _
Anchor:=Act_Cell, _
Address:="", _
SubAddress:="'" & actual.Parent.Name & _
"'!" & actual.Address(0, 0), _
TextToDisplay:=actual.Parent.Name & _
"!" & actual.Address(0, 0)
End Sub

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...
Sub Hyperlinkcell()
'
Dim actual As Range

Set actual = Application.InputBox( _
Prompt:="Select cell to hyperlink.", Type:=8)
ActiveSheet.Hyperlinks.Add _
Anchor:=Selection, _
Address:="", _
SubAddress:="'" & actual.Parent.Name & _
"'!" & actual.Address(0, 0), _
TextToDisplay:=actual.Text
End Sub


--
Regards,
Tom Ogilvy


"al007" wrote in message
ups.com...
Sub Hyperlinkcell()
'
Dim actual As Range

Set actual = Application.InputBox(Prompt:="Select cell to
hyperlink.", Type:=8)
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="",
SubAddress:=actual, TextToDisplay:=ActiveCell.Value
End Sub

Can anybody fix the above hyperlink macro pls.

Thxs




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
Macro runs in source , but not when in Personal Macro Workbook Darin Kramer Excel Programming 1 September 13th 05 04:48 PM
Personal macro workbook and personal.xls John Kilkenny Excel Discussion (Misc queries) 1 June 14th 05 09:43 PM
Intra-workbook hyperlink: macro/function to return to hyperlink ce marika1981 Excel Discussion (Misc queries) 3 May 6th 05 05:47 AM
personal.htm & personal.xls in Macro Rasoul Khoshravan Azar Excel Programming 0 January 21st 04 05:27 PM


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