Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default Passing range as an argument in a function

Hi,

I want to pass the values of an array in to a function. Please tell me how
to do it.

Here is my Array which is reading values from a sheet called sheet1

For n = 2 To 20
empclass(n - 2) = UCase(Sheets("sheet1").Cells(n, 251))
Next n


The function is already accepting lots of other values :-

Public Function Validate(ByVal sheetName As String, a As Integer, ByVal b As
Integer, ByVal c As Integer, ByVal d As Integer, ByVal e As Integer, ByVal f
As Integer, ByVal g As Integer, ByVal h As Integer) As Integer

Please tell me how I should define the empclass as one more argument in the
function.

Regards,
Hari
India


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Passing range as an argument in a function

Untested, but:

ByRef empclass() As String

should work.

--

Vasant

"Hari" wrote in message
...
Hi,

I want to pass the values of an array in to a function. Please tell me how
to do it.

Here is my Array which is reading values from a sheet called sheet1

For n = 2 To 20
empclass(n - 2) = UCase(Sheets("sheet1").Cells(n, 251))
Next n


The function is already accepting lots of other values :-

Public Function Validate(ByVal sheetName As String, a As Integer, ByVal b

As
Integer, ByVal c As Integer, ByVal d As Integer, ByVal e As Integer, ByVal

f
As Integer, ByVal g As Integer, ByVal h As Integer) As Integer

Please tell me how I should define the empclass as one more argument in

the
function.

Regards,
Hari
India




Reply
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
VBA - Passing a FUNCTION as an Argument James B Excel Programming 3 February 18th 04 03:42 PM
Passing range as argument Jan Kronsell[_2_] Excel Programming 3 September 3rd 03 12:31 PM
Passing an Array of User-Defined Type to an Argument of a Function Tushar Mehta[_6_] Excel Programming 0 August 17th 03 06:43 PM
passing a variable as an argument to a function Drew[_6_] Excel Programming 3 July 25th 03 08:51 PM


All times are GMT +1. The time now is 05:01 PM.

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

About Us

"It's about Microsoft Excel"