Blackvader
New Member
- Joined
- Apr 19, 2023
- Messages
- 1
- Office Version
- 2021
- Platform
- Windows
I have the following code which is supposed to loop through the links in a column, click each link and then proceed to the next row in that column. Except that, it isn't working. Any suggestions?
VBA Code:
Sub tumanaliz()
Dim lastRow As Long
Dim hyperlink As hyperlink
With Sheets("Listing")
lastRow = .Cells(.Rows.Count, "I").End(xlUp).Row
For i = 2 To lastRow
Set hyperlink = .Cells(i, "I").Hyperlinks(1)
If Not hyperlink Is Nothing Then
Application.StatusBar = "Processing row " & i
.Cells(2, 32).Value = .Cells(i, 30).Value ' Set value in cell AG2
hyperlink.Follow ' Click on the hyperlink
Application.Wait (Now + TimeValue("0:00:02")) ' Wait for 2 seconds
Application.StatusBar = ""
End If
Next i
End With
End Sub