The following code never gets to the ELSE and always displays the message box. I suspect that it is because when I print the variables lastrow is right justified and rowfound is left justified so they are not both numbers. But I am not sure and if so I don't know how to fix it.
Code:
'Get Row Number
rowfound = InputBox("What is the row number of the project?", "Input Row Number")
'If Input box is cancelled exit sub
If rowfound = "" Then
Exit Sub
End If
'Is row number valid?
lastrow = Sheets("Tracking Log").Range("B:B")(Rows.Count, 1).End(xlUp).Row
Debug.Print lastrow
Debug.Print rowfound
If rowfound < 15 Or rowfouund > lastrow Then
MsgBox "Row Number not valid", vbCritical, "Invalid Row Number"
Exit Sub
Else