Copying hyperlink formulae

I have created a hyperlink in Column C using =HYPERLINK(A;B).

This works but I want to copy Column C to Column D, preserving the hyperlink when I delete columns A & B.

I had expected DATA>CALCULATE>FORMULA TO VALUE to work, but it doesn’t. It leaves the cell text, but removes the hyperlink.
I have to do this in some automatic way as there are 17,000+ lines to be changed.

Very frustrated that I cannot get this to work. Any suggestions would be most welcome.

By the way, Export as PDF… leaves a no functioning link.

Move (Cut&Paste) instead of Copy&Paste the column, then references pointing to it will be adjusted.

But then you still can’t “delete columns A & B”.

I may have misunderstood. Clearer questions might lead to clearer answers.

Hi
it’s not clean (macro recorder my hated friend) but you can use that (change the number of line of course)
it will write your link based on col A B data into C (just change the destination if you must)
Not exactly your question but probably the result wanted


dim i as integer

const nbline = 17

sub hyper

rem ----------------------------------------------------------------------

rem define variables

dim document   as object

dim dispatcher as object


rem ----------------------------------------------------------------------

rem get access to the document

document   = ThisComponent.CurrentController.Frame

Feuille = ThisComponent.Sheets(0)

dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------

dim args1(0) as new com.sun.star.beans.PropertyValue

args1(0).Name = "ToPoint"

args1(0).Value = "C1"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())

for i = 0 to nbline
tmpo

next

end sub

'________________________________________________

sub tmpo

dim document   as object

dim dispatcher as object

dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")


rem ----------------------------------------------------------------------

rem get access to the document

document   = ThisComponent.CurrentController.Frame

Feuille = ThisComponent.Sheets(0)

dim args2(1) as new com.sun.star.beans.PropertyValue

args2(0).Name = "Hyperlink.Text"

args2(0).Value = Feuille.getCellByPosition(1 ,i).string 

args2(1).Name = "Hyperlink.URL"

args2(1).Value = Feuille.getCellByPosition(0 ,i).string

dispatcher.executeDispatch(document, ".uno:SetHyperlink", "", 0, args2())

rem ----------------------------------------------------------------------

'rem dispatcher.executeDispatch(document, ".uno:SetHyperlink", "", 0, Array())

dim args3(1) as new com.sun.star.beans.PropertyValue

args3(0).Name = "By"

args3(0).Value = 1

args3(1).Name = "Sel"

args3(1).Value = false

dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, args3())

end sub

Please use preformattted text when pasting code.

sorry, it didn’t worked