airportzoo
New Member
- Joined
- Jun 24, 2011
- Messages
- 14
Hello
I have the run time error '13' type mismatch problem on the line that I have bolded. I think I understand why the problem occurs (something to do with the value in the cell being a number, not a bit of text), I just don't know how to solve it.
What is really annoying about it all is that we don't get the error in Excel 2007 until the file is sent in an email, used in Excel 2010, and when it's sent back to be used in Excel 2007 again, the problem arises. I have to then revert to the backed up original '07 file before it was sent in the email.
Basically, this spreadsheet is used to send text messages to numbers in certain columns. If the relevant cell is empty, this error handler kicks in to collect a number from the user.
Is there a solution with the whole Excel 2007/2010 problem?
Any help you could give would be amazing.
I have the run time error '13' type mismatch problem on the line that I have bolded. I think I understand why the problem occurs (something to do with the value in the cell being a number, not a bit of text), I just don't know how to solve it.
What is really annoying about it all is that we don't get the error in Excel 2007 until the file is sent in an email, used in Excel 2010, and when it's sent back to be used in Excel 2007 again, the problem arises. I have to then revert to the backed up original '07 file before it was sent in the email.
Basically, this spreadsheet is used to send text messages to numbers in certain columns. If the relevant cell is empty, this error handler kicks in to collect a number from the user.
Code:
Dim PhNum As String
......
errhandler:
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
With ActiveSheet.Buttons(MyButton)
[B]PhNum = Application.InputBox("Phone number for employee missing. Text not sent." & vbNewLine & "Check name and employee number." & vbNewLine & vbNewLine & "If you know the number, type it into the box below," & vbNewLine & "WITHOUT ANY LEADING ZEROS AND WITH THE COUNTRY CODE I.E. 447906684330", Title:="Employee Contact", Default:=IIf(Range(.TopLeftCell, .BottomRightCell).Offset(, -2) >=[/B][B] "0", (Range(.TopLeftCell, .BottomRightCell).Offset(, -2).Value), "Enter the number here"), Type:=1)[/B]
If PhNum = vbNullString Then
ElseIf PhNum = "false" Then
Exit Sub
Is there a solution with the whole Excel 2007/2010 problem?
Any help you could give would be amazing.