thomassharp
Board Regular
- Joined
- Dec 10, 2014
- Messages
- 84
Hi I have been using the following code to activate hyperlinks for a long time:
But this morning it won't work and I get a 1004 object defined error which hasn't happened before.
here is a link to the workbook https://www.dropbox.com/s/mo0az4dxt6pmgtf/Sampleworkbook.xlsm?dl=0
Thank you!
Code:
Sub Test()
Dim LastRow As Long, i As Long
LastRow = Sheets("Sheet1").Range("B" & Rows.Count).End(xlUp).Row
For i = 2 To LastRow
With Cells(i, 2)
If .Value <> "" Then
ActiveSheet.Hyperlinks.Add Anchor:=.Cells(1, 1), Address:=.Value
End If
End With
Next i
End Sub
But this morning it won't work and I get a 1004 object defined error which hasn't happened before.
here is a link to the workbook https://www.dropbox.com/s/mo0az4dxt6pmgtf/Sampleworkbook.xlsm?dl=0
Thank you!