Hi folks
I have a macro, that when called will look through column 1 in sheet 2 and compare the text to column 1 sheet 1. If they match it will select the cell 2 to the left in sheet 1 and try and follow the filepath of the hyperlink in that cell.
My code is:
However when I run this macro I receive runtime error 9: Subscript out of range, and pressing debug highlights the following line:
I believe the problem lies in the fact that it is not actually picking up the filepath, but I'm not sure and it could be elsewhere.
Any ideas on how to solve this? I'd really appreciate any sort of help!
Thanks
I have a macro, that when called will look through column 1 in sheet 2 and compare the text to column 1 sheet 1. If they match it will select the cell 2 to the left in sheet 1 and try and follow the filepath of the hyperlink in that cell.
My code is:
Code:
Sub Importselect()
Dim a As Integer
For i = 3 To 15000
For a = 3 To 15000
name = Tabelle1.Cells(a, 1).Offset(0, 2).Hyperlinks.Item(1).Address
If Tabelle2.Cells(i, 1) = Tabelle1.Cells(a, 1) Then ImportTextFile FName:="name", Sep:=" "
Next a
Next i
End Sub
However when I run this macro I receive runtime error 9: Subscript out of range, and pressing debug highlights the following line:
Code:
If Tabelle2.Cells(i, 1) = Tabelle1.Cells(a, 1) Then ImportTextFile FName:="name", Sep:=" "
I believe the problem lies in the fact that it is not actually picking up the filepath, but I'm not sure and it could be elsewhere.
Any ideas on how to solve this? I'd really appreciate any sort of help!
Thanks