Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Why am I getting a Type Mismatch error an the line indicated below when call
the function? Thanks in advance!!! Sub Test() ' test if dimensions are rounded to nearest 16th Error If InvalidDimensions(tbxHeightFt, tbxHeightIns, tbxWidthFt, tbxWidthIns) Then MsgBox "Please round all dimensions to the nearest 1/16''.", vbCritical StopCode = True Exit Sub End If End Sub ' ensure dimensions must be rounded to the nearest 1/16th of an inch Function InvalidDimensions(Hft As Single, Hins As Single, _ Wft As Single, Wins As Single, _ Optional Dft As Single, Optional Dins As Single) As Boolean ' height If (Hft = 0 And Hins = 0) Or _ ((Hft * 12 + Hins) * 16 < Int(Hft * 12 + Hins) * 16) Then InvalidDimensions = True Exit Function End If ' width If (Wft = 0 And Wins = 0) Or _ ((Wft * 12 + Wins) * 16 < Int(Wft * 12 + Wins) * 16) Then InvalidDimensions = True Exit Function End If ' width If Not IsMissing(Dft) Or Not IsMissing(Dins) Then If (Dft = 0 And Dins = 0) Or _ ((Dft * 12 + Dins) * 16 < Int(Dft * 12 + Dins) * 16) Then InvalidDimensions = True Exit Function End If End If End Function -- Cheers, Ryan |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
"Compile Error: ByRef argument type mismatch" when calling my function from another module | Excel Programming | |||
runtime error 13 - type mismatch error in Excel 97 on Citrix | Excel Programming | |||
Type mismatch when calling sub with array of worksheets argument | Excel Programming | |||
Conditional Formatting - Run Time Error '13' Type Mismatch Error | Excel Programming | |||
Help: Compile error: type mismatch: array or user defined type expected | Excel Programming |