Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
InputBox
hi,
in VB , when I Cancel or close an InputBox instead of entering data in it,an error menu showing error 13 appears.how can I avoid the menu?????there is a commandbox on my worksheet that by pressing that an inputbox pops up,now when I close the inputbox without entering the data, the error comes up.but I need just close the inputbox and returning to the worksheet. thanx |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
InputBox
hi,
The button your are clicking is calling the inputbox. whoever wrote the code full well expected someone to enter something in the inputbox. by clicking cancel, this puts a null string in the variable. the code then trys to do something with the null string and error 13(type mismatch) occurs. No way around this. Are you trying to run a macro by clicking the button? if not, quit clicking the button. if you are then enter the appropriate input. If you feel that the input box is not suppose to pop up, then you need to re-write the code. Regards FSt1 "peyman" wrote: hi, in VB , when I Cancel or close an InputBox instead of entering data in it,an error menu showing error 13 appears.how can I avoid the menu?????there is a commandbox on my worksheet that by pressing that an inputbox pops up,now when I close the inputbox without entering the data, the error comes up.but I need just close the inputbox and returning to the worksheet. thanx |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
InputBox
thanx.I have a commandbutton in my worksheet by which an inputbox comes
up.here is the code: Private Sub CommandButton4_Click() Dim ROWNO As Integer ROWNO = InputBox("Please Enter Row No. To Change To Regular Part No.:", "Regular Parts") Cells(ROWNO + 12, 2) = Application.WorksheetFunction.Substitute(Cells(ROW NO + 12, 2), "bb", "") End Sub but I don't need the error 13 menu to pop up.any way?? "FSt1" wrote: hi, The button your are clicking is calling the inputbox. whoever wrote the code full well expected someone to enter something in the inputbox. by clicking cancel, this puts a null string in the variable. the code then trys to do something with the null string and error 13(type mismatch) occurs. No way around this. Are you trying to run a macro by clicking the button? if not, quit clicking the button. if you are then enter the appropriate input. If you feel that the input box is not suppose to pop up, then you need to re-write the code. Regards FSt1 "peyman" wrote: hi, in VB , when I Cancel or close an InputBox instead of entering data in it,an error menu showing error 13 appears.how can I avoid the menu?????there is a commandbox on my worksheet that by pressing that an inputbox pops up,now when I close the inputbox without entering the data, the error comes up.but I need just close the inputbox and returning to the worksheet. thanx |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
InputBox
On Sep 27, 7:23 pm, peyman wrote:
thanx.I have a commandbutton in my worksheet by which an inputbox comes up.here is the code: Private Sub CommandButton4_Click() Dim ROWNO As Integer ROWNO = InputBox("Please Enter Row No. To Change To Regular Part No.:", "Regular Parts") Cells(ROWNO + 12, 2) = Application.WorksheetFunction.Substitute(Cells(ROW NO + 12, 2), "bb", "") End Sub but I don't need the error 13 menu to pop up.any way?? "FSt1" wrote: hi, The button your are clicking is calling the inputbox. whoever wrote the code full well expected someone to enter something in the inputbox. by clicking cancel, this puts a null string in the variable. the code then trys to do something with the null string and error 13(type mismatch) occurs. No way around this. Are you trying to run a macro by clicking the button? if not, quit clicking the button. if you are then enter the appropriate input. If you feel that the input box is not suppose to pop up, then you need to re-write the code. Regards FSt1 "peyman" wrote: hi, in VB , when I Cancel or close an InputBox instead of entering data in it,an error menu showing error 13 appears.how can I avoid the menu?????there is a commandbox on my worksheet that by pressing that an inputbox pops up,now when I close the inputbox without entering the data, the error comes up.but I need just close the inputbox and returning to the worksheet. thanx This is how I would handle it. There are other ways of course. Private Sub CommandButton4_Click() Dim ROWNO As String start: ROWNO = InputBox("Please Enter Row No. " & _ "To Change To Regular Part No.:", _ "Regular Price") If ROWNO = "" Then Exit Sub ElseIf Not IsNumeric(ROWNO) Then MsgBox "Must be a number" GoTo start Else Cells(ROWNO + 12, 2) = _ Replace(Cells(ROWNO + 12, 2), "bb", "") End If End Sub |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
InputBox
hi,
it doesn't exit sub when ROWNO=""?! "JW" wrote: On Sep 27, 7:23 pm, peyman wrote: thanx.I have a commandbutton in my worksheet by which an inputbox comes up.here is the code: Private Sub CommandButton4_Click() Dim ROWNO As Integer ROWNO = InputBox("Please Enter Row No. To Change To Regular Part No.:", "Regular Parts") Cells(ROWNO + 12, 2) = Application.WorksheetFunction.Substitute(Cells(ROW NO + 12, 2), "bb", "") End Sub but I don't need the error 13 menu to pop up.any way?? "FSt1" wrote: hi, The button your are clicking is calling the inputbox. whoever wrote the code full well expected someone to enter something in the inputbox. by clicking cancel, this puts a null string in the variable. the code then trys to do something with the null string and error 13(type mismatch) occurs. No way around this. Are you trying to run a macro by clicking the button? if not, quit clicking the button. if you are then enter the appropriate input. If you feel that the input box is not suppose to pop up, then you need to re-write the code. Regards FSt1 "peyman" wrote: hi, in VB , when I Cancel or close an InputBox instead of entering data in it,an error menu showing error 13 appears.how can I avoid the menu?????there is a commandbox on my worksheet that by pressing that an inputbox pops up,now when I close the inputbox without entering the data, the error comes up.but I need just close the inputbox and returning to the worksheet. thanx This is how I would handle it. There are other ways of course. Private Sub CommandButton4_Click() Dim ROWNO As String start: ROWNO = InputBox("Please Enter Row No. " & _ "To Change To Regular Part No.:", _ "Regular Price") If ROWNO = "" Then Exit Sub ElseIf Not IsNumeric(ROWNO) Then MsgBox "Must be a number" GoTo start Else Cells(ROWNO + 12, 2) = _ Replace(Cells(ROWNO + 12, 2), "bb", "") End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
InputBox | Excel Discussion (Misc queries) | |||
inputbox | Excel Discussion (Misc queries) | |||
msgbox / inputbox etc | Excel Worksheet Functions | |||
Inputbox with VBA | Excel Discussion (Misc queries) | |||
Inputbox with Listbox | Excel Discussion (Misc queries) |