View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
mo childs mo childs is offline
external usenet poster
 
Posts: 2
Default How do I calculate an offset between two ranges?

x and y are single column ranges of the same size. How do I retrieve
the corresponding values to x & from y as I loop through x? See
example below and thanks for any help.

Function offset(x As Range, y As Range, test As String)

For Each icell In x
If icell.Value = test Then
' I want to use the value of the corresponding element of range y here
End If
Next

End Function

--
Mo