Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8807767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:26:58+00:00 2026-06-14T02:26:58+00:00

I have reduced my problem to the following test case: create a new workbook;

  • 0

I have reduced my problem to the following test case:

  1. create a new workbook;

  2. enter a constant value, e.g. 123 into Sheet1!A1;

  3. define a name, e.g. foo, that refers to the formula =CHOOSE(!$A$1, Sheet1!$A$1);

  4. enter the constant value 1 into Sheet2!A1;

  5. enter the formula =foo into some other cell on Sheet2, e.g. Sheet2!B1: observe that, as expected, the result is the value that was entered into Sheet1!A1 in step 2 above;

  6. create then run a VBA procedure containing the following code:

    Sheets("Sheet1").Outline.ShowLevels 1
    

You will notice that the cell from step 5 now contains a #VALUE! error.

Moreover, a simple sheet recalculation (whether using the F9 key or the Application.Calculate method) does not resolve the problem: one must instead perform either a full recalculation from VBA (using the Application.CalculateFull method) or else a full rebuild from the interactive UI (using the CTRL+ALT+SHIFT+F9 key combination).

Through trial-and-error, I have ascertained that for this condition to arise:

  • the CHOOSE() index argument must involve a relative-sheet cell reference (not constants or absolute-sheet references);

  • the CHOOSE() value argument that is being indexed must involve a reference to another sheet;

  • the change of displayed outline level must arise from within a VBA procedure (not from the outline controls in the interactive UI or the VBA Immediate Window); and

  • the ShowLevels method call (whose arguments are irrelevant) must be applied to a sheet that is referenced amongst any of the value (though not index) arguments to CHOOSE().

What’s going on?

I would very much like to collapse a worksheet that I am referencing amongst the value arguments to CHOOSE() to its highest outline level without triggering this error, as a full recalculation of my actual workbook (still only a few seconds) is undesirable from a UX standpoint.

Suggestions for a workaround (whilst still using a defined name containing the CHOOSE() function together with a relative-sheet index argument) would be most welcome!

My platform: Excel 2010 (14.0.6123.5001, 32-bit) on Windows 7 Home Premium (SP1, 64-bit).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:27:00+00:00Added an answer on June 14, 2026 at 2:27 am

    The problem is with your named formula: =CHOOSE(!$A$1, Sheet1!$A$1), specifically the !A1

    The leading ! is invalid (without a preceeding sheet name, eg Sheet1!$A$1 is valid). Just specify a sheet and your problem goes away.

    I suspect this may not satisfy you, depending on why you used !A1 in the first place. If it’s that you want =foo to use an index value from A1 on the sheet the formula =foo is placed on use INDIRECT("A1") instead of !A1


    BTW I think your may have found a bug, or at least undefned behaviour, in that the formula =CHOOSE(!$A$1, Sheet1!$A$1) is invalid and should always return a #Value error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've reduced my problem (table layout algorithm) to the following problem: Imagine I have
I have reduced the problem to the following basic function which should simply print
I have reduced a problem I'm having to the following example code: var inQueue
The problem we have is reduced to the following two statements: select convert(float, (convert(float,5741.61)/convert(float,
I have a problem with auto_ptr in Exception classes, that I eventually reduced to:
I have the following form, which I have reduced as much as I can,
I have the following record (reduced for brevity): [DelimitedRecord(,)] [IgnoreFirst] [IgnoreEmptyLines()] public class ImportRecord
I'm reading the reduction optimization in CUDA SDK, and I have problem following what
I'll try to illustrate my problem by the following example: I have linux kernel
I have the following problem: I have a multithreaded server-side application, where every request

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.