LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Passing range as argument

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing a range name as an argument to the Index Function Michael Sharpe Excel Discussion (Misc queries) 3 September 5th 12 01:33 PM
Passing a UDF as an argument to a UDF puff Excel Discussion (Misc queries) 3 February 23rd 06 09:46 PM
passing a variable as an argument to a function Drew[_6_] Excel Programming 3 July 25th 03 08:51 PM
Passing an argument to a quote Zach Excel Programming 1 July 25th 03 04:16 AM
Passing an argument to a quote Zach Excel Programming 1 July 25th 03 01:00 AM


All times are GMT +1. The time now is 07:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"