Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi NG
I have made a function, that works perfectly allright, doing some calculation based on the contents of two ranges, but I would like to pass the two ranges as arguments in stead of "hard-coding" them into the function. However i can'øt get it to work. This is the working code. Function JaNej() As String n = 0 m = 0 Application.Volatile For Each c In Range("d28:i28").Cells If c.Value = "nej" Then n = n + 1 Else n = n + 0 End If Next c For Each c In Range("d30:i30").Cells If c.Value = "nej" Then m = m + 1 Else m = m + 0 End If Next c If n 0 Then JaNej = "Nej" Else JaNej = "Ja" End If End Function Jan |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Passing a range name as an argument to the Index Function | Excel Discussion (Misc queries) | |||
Passing a UDF as an argument to a UDF | Excel Discussion (Misc queries) | |||
passing a variable as an argument to a function | Excel Programming | |||
Passing an argument to a quote | Excel Programming | |||
Passing an argument to a quote | Excel Programming |