View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ian Mangelsdorf Ian Mangelsdorf is offline
external usenet poster
 
Posts: 17
Default Functions and Ranges

I have a function that needs the input of 2 ranges say a1:a5 and ba:b5

how can I set this function up so I can drag over the ranges when
using the funciton in a work book (similar to what happens in
Vlookup). As it stands I have to input each cell individually here is
the start of the code

Function Sw_hyp(P1, P2, p3, p4, p5, sw1, sw2, sw3, sw4, sw5, Pc_hyp)

If sw5 = 0 Then
sample = 4
x5 = 0
y5 = 0
Else: sample = 5
End If

The if statement is there because I sometimes use 4 elements and
sometimes 5

Ive go the guts of the function working and returning correct values I
wanted to make it easier to use in the workbook

Cheers
Ian Mangelsdorf