+ Reply to Thread
Results 1 to 4 of 4

Indirect function #ref problem

  1. #1
    Registered User
    Join Date
    07-23-2012
    Location
    montreal
    MS-Off Ver
    Excel 210
    Posts
    6

    Indirect function #ref problem

    Hi everyone!

    I have a probleme with a indirect function. I am using it to catch some information in other sheets. It works well for my first 4 sheets but I get a ref error for the next 4 ones. I do not understant. I target the same cell in each sheet. for example here is the formula. INDIRECT(C19&"!i21") where cell c19 is the name of the target sheet. The problem may come from the name of the sheet whith have a space like "Head Office". I think it also could come from the fact that I delete this sheet and create a new one under the same name.
    Do you have any idea. I am getting crazy.

    Thanks for your help,


    Hugo

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Indirect function #ref problem

    if you have spaces or special names you must use quotes
    INDIRECT("'"&C19&"'!i21")
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Indirect function #ref problem

    Hi,

    Yes almost certainly the space is the problem. If you have a space in a sheet name then you need to include the single ' symbol. e.g.

    INDIRECT("'"&C19&"'!i21")

    In fact it's a good idea to always include it whether the sheet name has a space or not.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    07-23-2012
    Location
    montreal
    MS-Off Ver
    Excel 210
    Posts
    6

    Re: Indirect function #ref problem

    Thank you so much JP and Richard! I works perfectly. I did not know this trick.

    Thanks again

    Hugo

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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