+ Reply to Thread
Results 1 to 8 of 8

Indirect function giving #REF! error

  1. #1
    Forum Contributor
    Join Date
    12-26-2006
    Posts
    189

    Indirect function giving #REF! error

    Hi,

    I'm using the INDIRECT fucntion in a cell, reffering to another where is written the following:
    Please Login or Register  to view this content.
    As you can see, the text points to another file and to a specific cell named "COMPANY".

    The problem is that when the file "Data.xls" is opened, the INDIRECT function gives me the correct value, but when i close it, the cell gives ne #REF! error.
    Is there any way of the cell with the INDIRECT function gives the correct value all the time and not only when the reffered file is opened?

    Thanks!

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Indirect function giving #REF! error

    Hi mqdis,

    Indirect function does'nt work on closed workbooks...


    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Forum Contributor
    Join Date
    12-26-2006
    Posts
    189

    Re: Indirect function giving #REF! error

    Thanks dilipandey,

    Is there any when that i can do the same but with the workboo closed?

    Thanks

  4. #4
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Indirect function giving #REF! error

    you can include a macro to open that file
    see below code and modify it as per your need
    Workbooks.Open ("C:\Users\DILIPandey\Desktop\purchase list.xlsx")


    Regards,
    DILIPandey
    <click on below * if this helps>

  5. #5
    Forum Contributor
    Join Date
    12-26-2006
    Posts
    189

    Re: Indirect function giving #REF! error

    Dear DILIPandey,

    Thank you once more for the tip.

    But what if i want to use that code, but instead of writing the location of the file as you mentioned (between commas), what if i want to do the same but reffering a specific cell where i have the same text
    Please Login or Register  to view this content.
    .

    Thanks

  6. #6
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Indirect function giving #REF! error

    Okay.. enter the path (without quotes) in cell a1 and use below code:-
    Workbooks.Open (Range("a1").Value)


    Regards,
    DILIPandey
    <click on below * if this helps>

  7. #7
    Forum Contributor
    Join Date
    12-26-2006
    Posts
    189

    Re: Indirect function giving #REF! error

    Deart dilipandey,

    Sorry in my delay...
    Thanks for yur help. I think i solved my problem!

    Thanks!

  8. #8
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Indirect function giving #REF! error

    you are welcome mqdias



    Regards,
    DILIPandey
    <click on below * if this helps>

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1