Knockoutpie
Board Regular
- Joined
- Sep 10, 2018
- Messages
- 116
- Office Version
- 365
- Platform
- Windows
Hi all, I have the following code to loop through and open the URL in column CN, but i'm getting some issues.
The URL is the result of an IF statement, and can be one of 5 websites.
Physical clicks on the cell to open work fine, but i cannot figure out to how get VBA to open.
Links will start in cell CN2.
The URL is the result of an IF statement, and can be one of 5 websites.
Physical clicks on the cell to open work fine, but i cannot figure out to how get VBA to open.
Links will start in cell CN2.
VBA Code:
Sub OpenURLs()
Dim i As Integer
For i = 1 To ActiveSheet.Range("CN" & Rows.Count).End(xlUp).Row
Dim url As String
url = ActiveSheet.Range("CN" & i).Value
Application.FollowHyperlink url
' Copy the adjacent value in column CM
Dim valueToCopy As String
valueToCopy = ActiveSheet.Range("CM" & i).Value
ActiveSheet.Range("CM" & i).Copy
MsgBox "Click OK to continue to the next URL", vbOKOnly
Next i
End Sub