Knockoutpie
Board Regular
- Joined
- Sep 10, 2018
- Messages
- 116
- Office Version
- 365
- Platform
- Windows
I'm attempting to have the Cancel Button or Close Button on the input box to exit the sub, can anyone assist in executing that correctly?
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)
ActiveSheet.range("CN" & i) = InputBox("Enter Y or N for POD", "InputBox Example")
If inputValue = "" Then
End
Else
' Do something with the input value
End If
range("CN1").Select
ActiveCell.FormulaR1C1 = "POD"
Next i
End Sub
Last edited: