Knockoutpie
Board Regular
- Joined
- Sep 10, 2018
- Messages
- 116
- Office Version
- 365
- Platform
- Windows
This code snippit below loops through and opens URLs in column A, it copies the value in column CL, however i'd lke to remove the msgbox portion and instead have an input portion where the user will input a value which will be entered into CN.
Essentially,
Copy value in CL2, open URL in A2, Input box to have entrer value in CN2 - Loop to next row.
I imagine this would be done through an Input box, can anyone assist with this?
Essentially,
Copy value in CL2, open URL in A2, Input box to have entrer value in CN2 - Loop to next row.
I imagine this would be done through an Input box, can anyone assist with this?
VBA Code:
Sub openurl()
Dim EdgeLocation As String
Dim MyURL As String
Dim i As Integer
Dim ws1 As Worksheet
Dim lastRow As Long
Dim inputValue As Variant ' n
range("A1").Select
lastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
Set ws1 = Sheets("Page1_1")
EdgeLocation = "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" 'Location of Edge.exe in your PC
For i = 1 To lastRow
' Copy the adjacent value in column CM
Dim valueToCopy As String
valueToCopy = ActiveSheet.range("CL" & i).Value
ActiveSheet.range("CL" & i).Copy
' ActiveSheet.range("CL" & i).EntireRow.Interior.Color = RGB(0, 255, 0)
MyURL = ws1.Cells(i, 1)
Shell (EdgeLocation & " -url -newtab " & MyURL)
'If MsgBox("Continue to the next URL?", vbOKCancel + vbQuestion) = vbOK Then
'Else
'Statements to show before Exit the Process
'MsgBox "You have skipped the Process"
Exit Sub
End If
Next i
End Sub