Inputbox Error
Posted by Harry Pilauf on February 18, 2002 5:23 PM
When I run the following code in a procedure , the input box comes up and if I press the cancel button I get an Run-time error "type mismatch"
I need to do the "set" part as I want to go to that cell further down the procedure - so as to delete the row where the cell was
Can anyone please help
Thanks
Harry
Sub delete_rows()
Dim anssort As Integer
Set myrange3 = Application.InputBox(prompt:="Please point to the row you want deleted", Left:=350, Top:=150, Type:=8)
If myrange3 = False Then
anssort = MsgBox("Do you wish to sort the data now ?", vbYesNo, "Sort ?")
If anssort = vbNo Then
endproc
Else: tim = 5
End If
Else
myrange3.Select
myrange3.EntireRow.delete shift:=x1up
End If
End Sub