Hi,
I need that when input box is not being filled in, the macro (new_hyperlink_from_userform) would be terminated.
I've tried some methods to do this, below is one, but Excel still prints "FALSE" in the last row + 1 of column A.
Any idea why?
Option Explicit
Public Sub new_hyperlink_from_userform() 'adding new hyperlinks
With Worksheets("hyperlinks")
Dim last_row As Integer, company_name As String, company_hyperlink As String
last_row = .UsedRange.Rows.Count + 1
company_name = Application.InputBox("Company name?")
company_hyperlink = Application.InputBox("Company's website hyperlink?")
Select Case company_name
Case ""
.Range("a" & last_row).Clear
Case Is <> ""
.Range("a" & last_row).Value = company_name
End Select
End With
End Sub
Bookmarks