Dim Var1 As String, Var2 As String
Var1 = InputBox("Variable 1?")
Var2 = InputBox("Variable 2?")
If I have two string variables defined as:
sFirst = "ActiveCell.Value = Val(Var1)"
sSecond = "ActiveCell.Offset(, 1).Value = Val(Var2)"
The value of ActiveCell and ActiveCell.Offset matches that of Var1 and Var2
I wonder if someone could advise what I am doing wrong when the following will not work? What is it I am doing wrong? I get "run time error '13': Type Mismatch". Thanks so much.
If (sFirst) & " " & "And" & " " & (sSecond) Then
MsgBox "works"
End If
Var1 = InputBox("Variable 1?")
Var2 = InputBox("Variable 2?")
If I have two string variables defined as:
sFirst = "ActiveCell.Value = Val(Var1)"
sSecond = "ActiveCell.Offset(, 1).Value = Val(Var2)"
The value of ActiveCell and ActiveCell.Offset matches that of Var1 and Var2
I wonder if someone could advise what I am doing wrong when the following will not work? What is it I am doing wrong? I get "run time error '13': Type Mismatch". Thanks so much.
If (sFirst) & " " & "And" & " " & (sSecond) Then
MsgBox "works"
End If