View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Excelenator[_7_] Excelenator[_7_] is offline
external usenet poster
 
Posts: 1
Default Code to Assist with Nested Function, Also Using ISERROR


According to your last question you could change the line after the
"xIndexErr:" to read "xIndex = "" " or "xIndex = 0" . This will make
the function return a blank or zero instead of an error message. I'm
not sure if that will help or hurt your formula.


Paige Wrote:

Public Function xIndex(vRange, vRowVal, vColVal)
On Error GoTo xIndexErr
Application.Volatile
With Application.WorksheetFunction
xIndex = .Index(vRange, .Match(vColVal, vRange.Columns(1), 0),
..Match(vRowVal, vRange.Rows(1), 0))
End With
Exit Function
xIndexErr:
xIndex = CVErr(Err)
End Function

.....

Is there a way to adjust the VB code for the function so that if the
formula
returns an error message, the cell shows blank? Or is there a better
way to
do this? Thanks for any thoughts/suggestions.



--
Excelenator


------------------------------------------------------------------------
Excelenator's Profile: http://www.excelforum.com/member.php...o&userid=36768
View this thread: http://www.excelforum.com/showthread...hreadid=565399