Assigning Hyperlink to Cell via Macro

Hello Guys,
I’m trying to build a Macro that should write a URL link to a specific cell. After combining the URL and posting it into the cell with

oFormulaURL = "=HYPERLINK("""& oStringURL &""", ""click me"")"
outputCellURL.setFormula(oFormulaURL)

I am greeted with an Err:508 in the spreadsheet. However, making any single change in the input line for that cell and immediately reversing it fixes the error and I get a clickable link. Any idea what I’m missing here?

Also, on a less important note - is it possible to make the links from the HYPERLINK() function blue like the ones created using the Ctrl+K popup?

Cheers

The list separator in formulas is always the semicolon, no matter what may be shown in the user interface.

1 Like

Thanks, that fixed it.

You can add the line:

outputCellURL.cellstyle = "Hyperlink"
2 Likes