Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
DaveO
 
Posts: n/a
Default Help with INDIRECT function.

Using the INDIRECT function I'm trying to reference data in another Workbook.
However, if that workbook is not open the function returns a #REF! value.
Open the Workbook it's referencing and it happily returns the vlaue I need. I
understand it's one of the volatile functions in Excel, but I don't know why
it won't return return the value if the other sheet is not open.

Any ideas to help at all please??

TIA.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete
 
Posts: n/a
Default Help with INDIRECT function.

If you have not put the full path in the filename, Excel will assume
that the file is in the current directory and look there - if the file
is not in that directory then it is treated as a bad reference (hence
#REF error). Just copy the file into the current folder.

When the file is open it works okay because Excel can find the
reference.

Hope this helps.

Pete

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Help with INDIRECT function.

Take a look at Harlan Grove's PULL function that does do that

ftp://members.aol.com/hrlngrv/
Look for pull.zip


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"DaveO" wrote in message
...
Using the INDIRECT function I'm trying to reference data in another

Workbook.
However, if that workbook is not open the function returns a #REF! value.
Open the Workbook it's referencing and it happily returns the vlaue I

need. I
understand it's one of the volatile functions in Excel, but I don't know

why
it won't return return the value if the other sheet is not open.

Any ideas to help at all please??

TIA.



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
DaveO
 
Posts: n/a
Default Help with INDIRECT function.

Hi Bob, thanks for the help here on this function.

I've read the VBA and gone through it and have a basic understanding of
whats going on here. However, the PULL function can't handle arrays of data
by the looks of it. By this I mean that the pull function needs to return an
array of data as it exists inside of a VLOOKUP function.

Any more ideas at all please?

TIA.

"Bob Phillips" wrote:

Take a look at Harlan Grove's PULL function that does do that

ftp://members.aol.com/hrlngrv/
Look for pull.zip


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"DaveO" wrote in message
...
Using the INDIRECT function I'm trying to reference data in another

Workbook.
However, if that workbook is not open the function returns a #REF! value.
Open the Workbook it's referencing and it happily returns the vlaue I

need. I
understand it's one of the volatile functions in Excel, but I don't know

why
it won't return return the value if the other sheet is not open.

Any ideas to help at all please??

TIA.






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Help with INDIRECT function.

No, I think it was just written to handle single cells. I will suggest to
Harlan that he enhances it.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"DaveO" wrote in message
...
Hi Bob, thanks for the help here on this function.

I've read the VBA and gone through it and have a basic understanding of
whats going on here. However, the PULL function can't handle arrays of

data
by the looks of it. By this I mean that the pull function needs to return

an
array of data as it exists inside of a VLOOKUP function.

Any more ideas at all please?

TIA.

"Bob Phillips" wrote:

Take a look at Harlan Grove's PULL function that does do that

ftp://members.aol.com/hrlngrv/
Look for pull.zip


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"DaveO" wrote in message
...
Using the INDIRECT function I'm trying to reference data in another

Workbook.
However, if that workbook is not open the function returns a #REF!

value.
Open the Workbook it's referencing and it happily returns the vlaue I

need. I
understand it's one of the volatile functions in Excel, but I don't

know
why
it won't return return the value if the other sheet is not open.

Any ideas to help at all please??

TIA.






  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
DaveO
 
Posts: n/a
Default Help with INDIRECT function.

I've spent the past hour or so just going through the code Bob and have found
an answer.

In the code at the very end Harlan has a line that reads ...

pull = r.Value

I've altered this in my code to now read ...

pull = r.Value2

and it allows array values. Perhaps a quick check of the variables (using a
simple IF) would enhance this to be able to be used in all situations.

Also, a quick caveat in case you do speak to him about this. I'd suggest
that somewhere in the code he tries to tell the suer to limit the array that
is returned to an absolute minimum else the function will take a long time to
return a value. Only trying to help out here and certainly don;t wish to seem
ungrateful for what is a great bit of code!

Thanks again!

Dave.



"Bob Phillips" wrote:

No, I think it was just written to handle single cells. I will suggest to
Harlan that he enhances it.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"DaveO" wrote in message
...
Hi Bob, thanks for the help here on this function.

I've read the VBA and gone through it and have a basic understanding of
whats going on here. However, the PULL function can't handle arrays of

data
by the looks of it. By this I mean that the pull function needs to return

an
array of data as it exists inside of a VLOOKUP function.

Any more ideas at all please?

TIA.

"Bob Phillips" wrote:

Take a look at Harlan Grove's PULL function that does do that

ftp://members.aol.com/hrlngrv/
Look for pull.zip


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"DaveO" wrote in message
...
Using the INDIRECT function I'm trying to reference data in another
Workbook.
However, if that workbook is not open the function returns a #REF!

value.
Open the Workbook it's referencing and it happily returns the vlaue I
need. I
understand it's one of the volatile functions in Excel, but I don't

know
why
it won't return return the value if the other sheet is not open.

Any ideas to help at all please??

TIA.






  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Help with INDIRECT function.

Thanks Dave, I will look at all that and pass it on.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"DaveO" wrote in message
...
I've spent the past hour or so just going through the code Bob and have

found
an answer.

In the code at the very end Harlan has a line that reads ...

pull = r.Value

I've altered this in my code to now read ...

pull = r.Value2

and it allows array values. Perhaps a quick check of the variables (using

a
simple IF) would enhance this to be able to be used in all situations.

Also, a quick caveat in case you do speak to him about this. I'd suggest
that somewhere in the code he tries to tell the suer to limit the array

that
is returned to an absolute minimum else the function will take a long time

to
return a value. Only trying to help out here and certainly don;t wish to

seem
ungrateful for what is a great bit of code!

Thanks again!

Dave.



"Bob Phillips" wrote:

No, I think it was just written to handle single cells. I will suggest

to
Harlan that he enhances it.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"DaveO" wrote in message
...
Hi Bob, thanks for the help here on this function.

I've read the VBA and gone through it and have a basic understanding

of
whats going on here. However, the PULL function can't handle arrays of

data
by the looks of it. By this I mean that the pull function needs to

return
an
array of data as it exists inside of a VLOOKUP function.

Any more ideas at all please?

TIA.

"Bob Phillips" wrote:

Take a look at Harlan Grove's PULL function that does do that

ftp://members.aol.com/hrlngrv/
Look for pull.zip


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"DaveO" wrote in message
...
Using the INDIRECT function I'm trying to reference data in

another
Workbook.
However, if that workbook is not open the function returns a #REF!

value.
Open the Workbook it's referencing and it happily returns the

vlaue I
need. I
understand it's one of the volatile functions in Excel, but I

don't
know
why
it won't return return the value if the other sheet is not open.

Any ideas to help at all please??

TIA.








  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove
 
Posts: n/a
Default Help with INDIRECT function.

"DaveO" wrote...
....
I've read the VBA and gone through it and have a basic understanding of
whats going on here. However, the PULL function can't handle arrays of data
by the looks of it. By this I mean that the pull function needs to return
an
array of data as it exists inside of a VLOOKUP function.

Any more ideas at all please?

....

Testing is good. Testing would have shown that pull *CAN* return arrays.

The only difference between the .Value and .Value2 properties is that the
former can return values of Date type while the latter converts such values
into Double type. Both evaluate to arrays when applied to multiple cell,
single area ranges.

As for alternatives, try the INDIRECT.EXT function in Laurent Longre's
MOREFUNC.XLL add-in, available from

http://xcell05.free.fr/english/


  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
DaveO
 
Posts: n/a
Default Help with INDIRECT function.

Harlan, my apologies it was in the way that I was using it and not the code
itself. I found that out when I had to do further work on it last night.

I do have one last question. The Pull function's speed depends on the amount
of data that it has to return. Obviously I'm trying to get this as slick as
possible, so with a VLOOKUP({Cell}, Pull{}, {Row}, {True/False}) I want to
return only the smallest dataset possible (ie. Only 2 rows of data). I've
tried using this ... A1:A500, C1:C500 ... as my dataset. When I do it throws
a problem, but as it's a custom function I can't get any help. I've stepped
through the VBA and can't see why this shouldn't work, but still at a bit of
loss as to why it's a problem.

Also, I do have 1 question about the code. One line you have in there is
this...

Pull = Evaluate(xref)

Can you explain what this does as I'm at a loss, unless it's to produce an
error code so that you can test what state the function is currently in? It
confused me and an explanation of what it does would really help me.

Again, apologies for the inaccuracy of my comments to Bob, it was a genuine
mistake born of poor understanding.

TIA.

"Harlan Grove" wrote:

"DaveO" wrote...
....
I've read the VBA and gone through it and have a basic understanding of
whats going on here. However, the PULL function can't handle arrays of data
by the looks of it. By this I mean that the pull function needs to return
an
array of data as it exists inside of a VLOOKUP function.

Any more ideas at all please?

....

Testing is good. Testing would have shown that pull *CAN* return arrays.

The only difference between the .Value and .Value2 properties is that the
former can return values of Date type while the latter converts such values
into Double type. Both evaluate to arrays when applied to multiple cell,
single area ranges.

As for alternatives, try the INDIRECT.EXT function in Laurent Longre's
MOREFUNC.XLL add-in, available from

http://xcell05.free.fr/english/





  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Help with INDIRECT function.

Evaluate takes an Excel expression and converts it to an object or value in
VBA. So you can build a formula string within VBA and pass that to Evaluate
to get the result, or as I recall happens in this case, it gets the value in
the cell identified in xref. This is in case the workbook is already open,
saving having to start an Excel instance in which to get that cell value.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"DaveO" wrote in message
...
Harlan, my apologies it was in the way that I was using it and not the

code
itself. I found that out when I had to do further work on it last night.

I do have one last question. The Pull function's speed depends on the

amount
of data that it has to return. Obviously I'm trying to get this as slick

as
possible, so with a VLOOKUP({Cell}, Pull{}, {Row}, {True/False}) I want to
return only the smallest dataset possible (ie. Only 2 rows of data). I've
tried using this ... A1:A500, C1:C500 ... as my dataset. When I do it

throws
a problem, but as it's a custom function I can't get any help. I've

stepped
through the VBA and can't see why this shouldn't work, but still at a bit

of
loss as to why it's a problem.

Also, I do have 1 question about the code. One line you have in there is
this...

Pull = Evaluate(xref)

Can you explain what this does as I'm at a loss, unless it's to produce an
error code so that you can test what state the function is currently in?

It
confused me and an explanation of what it does would really help me.

Again, apologies for the inaccuracy of my comments to Bob, it was a

genuine
mistake born of poor understanding.

TIA.

"Harlan Grove" wrote:

"DaveO" wrote...
....
I've read the VBA and gone through it and have a basic understanding of
whats going on here. However, the PULL function can't handle arrays of

data
by the looks of it. By this I mean that the pull function needs to

return
an
array of data as it exists inside of a VLOOKUP function.

Any more ideas at all please?

....

Testing is good. Testing would have shown that pull *CAN* return arrays.

The only difference between the .Value and .Value2 properties is that

the
former can return values of Date type while the latter converts such

values
into Double type. Both evaluate to arrays when applied to multiple cell,
single area ranges.

As for alternatives, try the INDIRECT.EXT function in Laurent Longre's
MOREFUNC.XLL add-in, available from

http://xcell05.free.fr/english/





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
Using INDIRECT in INDEX(LINEST.. ) function Incoherent Excel Worksheet Functions 4 January 10th 06 04:42 PM
include INDIRECT function into SUMPRODUCT formula markx Excel Worksheet Functions 1 November 9th 05 05:04 PM
INDIRECT Function - what am I doing wrong? MACRE0 Excel Discussion (Misc queries) 2 October 5th 05 08:47 PM
INDIRECT function question Joe Excel Worksheet Functions 1 February 14th 05 03:54 PM
Indirect( ) function loosing values when spreadsheets are closed Word4Dummies Excel Worksheet Functions 2 February 13th 05 12:41 PM


All times are GMT +1. The time now is 04:50 PM.

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"