Dear forum,

When I hit cancel on an InputBox, I receive the error message:

Run-time error '13':
Type mismatch and it highlights

If v then as the suspect code.

The full code I am using is below - can anyone help me with the obvious mistake, I'm not even a begginer at this stuff!

Thanks for any advice.

Sub Opening_Weekly_Stock(ByVal control As IRibbonControl)
Dim sName As String
Dim sPic As String


sPic = Application.InputBox("Enter the Week To be Copied:", Title:="Source Week Title", Type:=2)
If sPic = "" Then Exit Sub

Dim v: v = Evaluate("ISREF(" & sPic & "!A1)")
If v Then
sName = Application.InputBox("Enter the new week name:", Title:="New Week Title", Type:=2)
If sName = "" Then Exit Sub
Sheets(sPic).copy After:=Sheets(Sheets.Count)
ActiveSheet.Name = sName
Else
MsgBox "The Worksheet " & sPic & " cannot be found."
End If
Call Enter_Opening_Stock
Call Remove_Zero_Stock
End Sub