LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Fredouille
 
Posts: n/a
Default creating function (vba) with range arguments

Hi,

I need to create a new function in VBA (this function is similar to the
vlookup one). This new function will have a range of cells as arguments.

public function myFunction (x as Range) as String

As a formula in one cell, I have
=myFunction('D:\anAnotherWb.xls]aSheet'!$A$1:$T$59)

I have the right result when x points on a range of cells in an already
opened workbook.
If x points to an existing workbook not already opened, I have a value error.

If you run the vlookup function, this problem do not appear. I'm pretty sure
the matter is the function declaration.


What would you do to solve my problem ?


Thx

 
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
Problem adding a range using Sumif function. vrk1 Excel Worksheet Functions 2 June 22nd 05 06:05 PM
Excel option to store trendline's coefficients in cells for use Miguel Saldana Charts and Charting in Excel 9 June 20th 05 08:45 PM
Function that filters a list (Database) for criteria in a range a. FirstVette52 Excel Worksheet Functions 0 February 8th 05 04:37 PM
Function to determine if any cell in a range is contained in a given cell [email protected] Excel Worksheet Functions 3 February 7th 05 04:19 PM
Formula to list unique values JaneC Excel Worksheet Functions 4 December 10th 04 12:25 AM


All times are GMT +1. The time now is 01:46 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"