hyperlink formula to its result in same cell

A

arne

I'm stucked; what am I doing wrong?

problem, get rid of the hyperlink formula and have the name in A show,
'and the link to open when activate1
Arne

Sub make_hyperlink()
' Sheet filled with names in A col and their belonging url in B col
' create a hyperlink with the name (A)AND url from (B) in col C
' And remove the formula Hyperlink, but keep the result in C
'Example in COL
'A: Google
'B: http://www.google.com/
'C: gives Google with hyperlink

Dim myrow As Long
With ActiveSheet
myrow = Range("A" & Rows.Count).End(xlUp).Row
Range("C1:C" & myrow).Formula
="=trim(HYPERLINK(RC[-1],RC[-2]))"
End With
End Sub
 
N

NickHK

Arne,
If you do not want the HYPERLINK function, don't use it.
This is what I got recording a macro of the cell right-click>hyperlink
action:

ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
"Sheet1!A1", TextToDisplay:="Sheet1!A1"

You should be able to change this to include the values of Range("A1") and
Range("B1") .

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top