+ Reply to Thread
Results 1 to 3 of 3

Prevent (Volatile) RANDBETWEEN Auto-ReCalculation WITHOUT using VBA

  1. #1
    Registered User
    Join Date
    11-28-2017
    Location
    Virginia
    MS-Off Ver
    2013
    Posts
    1

    Prevent (Volatile) RANDBETWEEN Auto-ReCalculation WITHOUT using VBA

    In my Excel 2013 workbook of four worksheets, one worksheet has a column of about 20 cells in each of which I need to randomly choose (i.e., display) one of four pre-defined short text strings. The random selection of which string must be done ONLY when the spreadsheet is opened and once chosen/displayed, the chosen text string remains constant regardless of other activity or editing throughout that user session.

    I have been playing with RANDBETWEEN but since that is a volatile function, my random string choices recalculate every time a change is made anywhere else in the entire workbook, which is a full-blown dealbreaker.

    So far, each of these 20 cells contains this same formula:

    =INDEX(Sheet1!$A$1:$A$4,RANDBETWEEN(1,4),1)

    where cells A1:A4 on Sheet1 contain (for sake of argument) the text strings Apple, Banana, Lime and Pear

    This formula does EXACTLY what I want it to do, but it (not surprisingly) displays a new random string from among those four in every one of the 20 cells every time I “touch the keyboard”.

    The complications:

    My workbook is stored, maintained and for use only on my employer’s network, in which the system administrators tightly control user-permitted activities. This workbook must be shared with others on this same network, so I cannot ensure that any recipient needing to see and use it will have disabled Automatic Recalculation (set it to Manual) on their machine or in their profile. I must assume that every recipient will have Auto Recalculate set to "on" which is the default. On top of that, all user VBA access is forbidden - users cannot enter or edit modules, UDFs, etc, so I’m stuck with finding a pre-defined Excel function or combination of functions.

    Is this even possible?

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,257

    Re: Prevent (Volatile) RANDBETWEEN Auto-ReCalculation WITHOUT using VBA

    I would create a hidden sheet with sufficient values - thousands of values in groups of twenty down a column - to allow multiple days of values to be extracted based on dates, with a formula like

    =INDEX(HiddenSheet!$A:$A,(TODAY()-DATE(2017,11,28))*20+ROW(A1))

    copied to 19 other cells. Replace +ROW(A1) with +COLUMN(A1) if you are copying across rather than down.


    If you have multiple users, you could use a column of values for each user, too, with a formula like

    =INDEX(HiddenSheet!$A:$Z,(TODAY()-DATE(2017,11,28))*20+ROW(A1),MATCH(username,UserList,False))

    Further, you should get somebody in IT with a brain - disabling macro use is like giving a fully stocked toolbox to a carpenter and saying "you can only use the hammer no matter what"
    Last edited by Bernie Deitrick; 11-28-2017 at 03:07 PM.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Prevent (Volatile) RANDBETWEEN Auto-ReCalculation WITHOUT using VBA

    maybe without formulas?
    analysis ToolPak
    random number generation
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Prevent Worksheet Recalculation with Macro that Pastes
    By Elieson in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-28-2015, 09:26 AM
  2. Prevent recalculation when opening .csv file
    By duffry in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-05-2014, 09:20 AM
  3. make randbetween() non volatile?
    By kamelkid2 in forum Excel General
    Replies: 2
    Last Post: 05-16-2012, 02:12 PM
  4. Restricting the Automatic Recalculation of Volatile Functions
    By ExcelTip in forum Tips and Tutorials
    Replies: 0
    Last Post: 08-29-2005, 11:06 AM
  5. Prevent recalculation when opening earlier versions
    By rjamison in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-13-2005, 08:05 PM
  6. [SOLVED] Re: Prevent recalculation when opening earlier versions
    By rjamison in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-13-2005, 08:05 PM
  7. [SOLVED] Prevent recalculation when opening earlier versions
    By Mats Nilsson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-20-2005, 12:06 PM

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