Sub URL_List()
For Each cell In Selection
If cell.Value <> "" Then
If Left(cell.Value, 7) = "http://" Then
URL = cell.Value
Else
URL = "http://" + cell.Value
End If
ActiveSheet.Hyperlinks.Add Anchor:=cell, _
Address:=URL, TextToDisplay:=cell.Value
End If
Next cell
End Sub
I don't know the source of this macro it proved useful today. I hope you can make some use of it.
The directions on creating a macro in Excel can be found in Excel's help which I'll repeat here:
Create a macro using Microsoft Visual Basic
- On the Tools menu in Microsoft Excel, point to Macro, and then click Visual Basic Editor.
- On the Insert menu, click Module.
- Type or copy your code into the code window of the module.
- If you want to run the macro (macro: An action or a set of actions that you can use to automate tasks. Macros are recorded in the Visual Basic for Applications programming language.) from the module window, press F5.
- When you're finished writing your macro, click Close and Return to Microsoft Excel on the File menu.
No comments:
Post a Comment