View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ExcelMonkey ExcelMonkey is offline
external usenet poster
 
Posts: 553
Default Can't pass publically defined variable to a function

I have a variable called "cell" which I have dimensioned as a Range. I also
have a function called AdjustForUniqueFormula. When I pass this public
variable to the funtion

AdjustForUniqueFormula(cell)

I get a Run Time Error 13 Type Mismatch. Why is this?

If AdjustForUniqueFormula(cell) = True Then
Exit Sub
Else
'Do Something........
End if

Public Function AdjustForUniqueFormula()

If UniqueFormulasAdjustChkBx = True Then
If Not IsError(Application.WorksheetFunction.Match(cell.P arent.Name &
"!" & cell.Address, UniqueCellAddressArray3, 0) - 1) Then
AdjustForUniqueFormula = False
Else
AdjustForUniqueFormula = True
End If
Else
AdjustForUniqueFormula = False
End If
End Function