How can I turn them all into hyperlinks automatically? I tried the following macro,
Code: Select all
Sub ConvertToHyperlinks()
Dim Cell As Variant
For Each Cell In Selection
Cell.Hyperlinks.Add Cell, "http://" & Cell.Text
Next
End SubCode: Select all
Sub ConvertToHyperlinks()
Dim Cell As Variant
For Each Cell In Selection
Cell.Hyperlinks.Add Cell, "http://" & Cell.Text
Next
End SubOuch. Yep. My bad. I was testing it with all the same IP and I forgot that that's the point of that shortcut: copy one cell into all the selected cells.Synthex wrote:... just copies the first IP address, strange.
I know, there's nothing wrong with the method, I'd just preffer to keep spreadsheet data small as possible.RoryOF wrote:Why not put in the extra column, then Hide it?
Hi, I tried Q35/A35 from Tutorial too, but got only one IP in the last row hyperlinked.(cell, that was active when rows was selected). The data in the other rows not hyperlinked and leading "http://" is missing too.
Code: Select all
Dim sh As Object, z As Object, c As Object
Dim qCells As Object, enuCells As Object
sh = ThisComponent.Sheets.getByName("YourSheetName")
z = sh.getCellRangeByName("B2:B5") ' your column (or rectangle)
qCells = z.queryContentCells(-1)
enuCells = qCells.Cells.createEnumeration
Do While enuCells.hasMoreElements
c = enuCells.nextElement
c.Formula = "=HYPERLINK(""http://" & c.String & """)"
LoopI know this topics is marked Solved, but I'm pretty sure the procedure in A35 works. I tested it before putting it in the tutorial and I retested again today. The procedure works on my system (OOo 3.2 on Mac OS level 10.6.8). I suspect the problem could be that you didn't follow the instructions.Synthex wrote:I tried Q35/A35 from Tutorial too, but got only one IP in the last row hyperlinked.(cell, that was active when rows was selected)
| Edit: The lines above should say "column with the web addresses" instead of "column with the email addresses" |