Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello all, I'm not sure what i am doing wrong and need your help please.
I wrote a code that asks the user for the row number they wish to delete. But i keep getting the following error message: Run-Time error '13' - Type mismatch. Here is the code i wrote: Sub Del_Row() ' Ask user for the row number Dim RowToDelete As Long RowToDelete = InputBox( _ Prompt:="Please enter the row number you wish to delete, eg: 23", _ Title:="Which Row Do You Wish to Delete?") ' exit sub if user presses 'cancel' If RowToDelete = "" Then Exit Sub End If if RowToDelete 20 then Rows(RowToDelete).delete Else MsgBox "Sorry! You cannot delete This row." End If End Sub When i run the macro, i get the inputbox asking me for the number but when i press cancel or enter a number i keep getting the above error message. Any ideas? I'm using Excel 2003 Thanks in advance Tendresse |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
error 13 type mismatch input box | Excel Discussion (Misc queries) | |||
Type Mismatch: array or user defined type expected | Excel Programming | |||
Type mismatch using rnge as Range with Type 8 Input Box | Excel Programming | |||
input box date type mismatch | Excel Programming | |||
Help: Compile error: type mismatch: array or user defined type expected | Excel Programming |