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

I have a named range called "Temperature" that is 1 x 10 vector.

I have a function x(ByVal value1 as double, Byval value2 as double) that I
need to run on all 10 temperatures.

When I go x(4,5) the function works.

When I go x(Temperature,5) the function gives #VALUE! error. My intent is
that the function will pull the Temperature value from the vector in the
column above it (or row beside it).

Little help?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Passing a named range to a function

Hard to know what you are trying to do, and hence it is hard to make
specific recommendations, when you hide the code from us. I can tell you
that your first argument is expecting a simple variable of type Double and
you are attempting to pass a Range (which is not a simple variable) into it.
You might be able to overcome that by using a Variant, then testing the type
of data that was passed in and reacting to that. Again, seeing your code
would make it easier to recommend something. By the way, is the Temperature
range **always** the one you want to do your calculations from... or could
there be other named ranges that the function will need to be able to
process?

--
Rick (MVP - Excel)


"Mike M 91107" wrote in message
...
I have a named range called "Temperature" that is 1 x 10 vector.

I have a function x(ByVal value1 as double, Byval value2 as double) that I
need to run on all 10 temperatures.

When I go x(4,5) the function works.

When I go x(Temperature,5) the function gives #VALUE! error. My intent is
that the function will pull the Temperature value from the vector in the
column above it (or row beside it).

Little help?


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 to a function Isabelle[_2_] Excel Programming 1 January 23rd 06 10:24 PM
Passing Excel NAMED Range to VBA BG Excel Worksheet Functions 4 July 28th 05 05:23 PM
Passing a named range into a user defined function Simon Shaw Excel Programming 2 March 15th 05 09:33 PM
passing named range to a UDF user defined function Brian Murphy Excel Programming 3 June 13th 04 08:38 PM
Passing a named range to a chart/series object CraigBarton Excel Programming 0 May 24th 04 03:45 AM


All times are GMT +1. The time now is 03:37 AM.

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"