Excel VBA question -- hyperlinks
Is this possible: I'm pasting a group of URLs that are just in a regular text format into an Excel column. Is there a piece of code that will loop thru each cell in that column and convert the text URLs into regular hyperlinks (that actually go where they're supposed to when clicked?) I tried "paste as hyperlink" already but this doesn't seem to work correctly when more than one cell is being pasted. Thanks. [email protected]
Re: Excel VBA question -- hyperlinks
Create a button called button1 and place this code in the click event. now select the cells that need to be converted and click on the button. here is the code:
Dim myRange as Range
Dim myCell as Range
Sub Button1_Click()
set myRange = Application.Selection
for Each myCell In myRange.Cells
myCell.Hyperlinks.Add myCell, myCell.Value
next
End Sub
I hope the code is self-explanatory
Happy Diwali
Bye,
Mani. S ( [email protected] )
PS: in case you didnt know, Diwali is the festival of lights celebrated in India!!!
Re: Excel VBA question -- hyperlinks