F
FARAZ QURESHI
Upon running the following code I get a message "Compile Error: Object
Required"
Sub FQCHECK()
Dim FQTEXT As String
Set FQTEXT = Application.InputBox(PROMPT:="Insert Keyword", Type:=2)
MsgBox ("YOU TYPED " & FQTEXT)
End Sub
While the following code executes perfectly:
Sub FQCHECK()
Dim FQRANGE As Range
Set FQRANGE = Application.InputBox(PROMPT:="SELECT CELL", Type:=8)
MsgBox ("YOU SELECTED " & FQRANGE.Address)
End Sub
What might be the cause? Is the Set statement only suitable for selection
range? Because the first piece of code works fine if entered as:
Sub FQCHECK()
Dim FQTEXT As String
FQTEXT = Application.InputBox(PROMPT:="Insert Keyword", Type:=2)
MsgBox ("YOU TYPED " & FQTEXT)
End Sub
Required"
Sub FQCHECK()
Dim FQTEXT As String
Set FQTEXT = Application.InputBox(PROMPT:="Insert Keyword", Type:=2)
MsgBox ("YOU TYPED " & FQTEXT)
End Sub
While the following code executes perfectly:
Sub FQCHECK()
Dim FQRANGE As Range
Set FQRANGE = Application.InputBox(PROMPT:="SELECT CELL", Type:=8)
MsgBox ("YOU SELECTED " & FQRANGE.Address)
End Sub
What might be the cause? Is the Set statement only suitable for selection
range? Because the first piece of code works fine if entered as:
Sub FQCHECK()
Dim FQTEXT As String
FQTEXT = Application.InputBox(PROMPT:="Insert Keyword", Type:=2)
MsgBox ("YOU TYPED " & FQTEXT)
End Sub