D
D
Hey guys-
Got a simple little script here that someone else wrote for me. It
hyperlinks contents from one column to the contents of another. Problem is,
when one or more cells are blank in either column (either the location or
the friendlyname column), the macro breaks. I need something that will tell
it to ignore blank cells and keep going until the end. Can someone tell me
how to do this? Thanks!
Here's the code...
Sub CreateLinks()
Dim LinkRange As Range, cell As Range
Set LinkRange = Range("G1", Range("G65536").End(xlUp))
For Each cell In LinkRange
ActiveSheet.Hyperlinks.Add Anchor:=cell, Address:= _
Range("R" & cell.Row).Value, TextToDisplay:=cell.Value
Range("R" & cell.Row).ClearContents
Next
End Sub
Thanks!
D
Got a simple little script here that someone else wrote for me. It
hyperlinks contents from one column to the contents of another. Problem is,
when one or more cells are blank in either column (either the location or
the friendlyname column), the macro breaks. I need something that will tell
it to ignore blank cells and keep going until the end. Can someone tell me
how to do this? Thanks!
Here's the code...
Sub CreateLinks()
Dim LinkRange As Range, cell As Range
Set LinkRange = Range("G1", Range("G65536").End(xlUp))
For Each cell In LinkRange
ActiveSheet.Hyperlinks.Add Anchor:=cell, Address:= _
Range("R" & cell.Row).Value, TextToDisplay:=cell.Value
Range("R" & cell.Row).ClearContents
Next
End Sub
Thanks!
D