+ Reply to Thread
Results 1 to 6 of 6

manual calculatin of the RAND function

  1. #1
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Key West, FL
    MS-Off Ver
    365 Apps for Enterprise
    Posts
    665

    manual calculatin of the RAND function

    I've got a workbook which will assign numbers to various rows. I want to increase these numbers by a random value. The problem with the RAND function is that it recalculates itself every time I recalculate the workbook. Is there a way (other than copy/pasting hard numbers) to have all the RAND functions in a sheet operate manually, say with a button? (one button... calculates all RAND formulas, once).

    Thanks!

  2. #2
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: manual calculatin of the RAND function

    Quote Originally Posted by jrtaylor View Post
    ...Is there a way ...
    Not using worksheet functions. Your best bet is a macro (which you can assign to a button). If possible, upload a copy of your workbook.
    Remove any sensitive or extraneous info, mainly just show us the formulas that use the RAND() function and the cells that contain them.

    To attach a workbook:
    Click Edit Post (or just start a new reply.)
    Click Go Advanced
    Scroll down to Manage Attachments and click.
    Now just Browse for your file, then click Upload. Simple!
    Last edited by leelnich; 08-05-2017 at 08:47 PM.

  3. #3
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Key West, FL
    MS-Off Ver
    365 Apps for Enterprise
    Posts
    665

    Re: manual calculatin of the RAND function

    Thanks. File is attached which I hope has enough info for you.
    Attached Files Attached Files

  4. #4
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: manual calculatin of the RAND function

    Please verify:
    1) Column C is checked from row 6 down. (Macro can find the bottom each time it runs.)
    2) Each "buy" or "sell" in column C gets a code in column A. (Are there any other entry types in column C?)
    3) Codes start with a set number (Note- Stored in a cell? or in macro itself? or as Defined Name in Name Manager?)
    4) Starting from top, each new code adds 1-300 to previous value.
    Last edited by leelnich; 08-05-2017 at 09:37 PM.

  5. #5
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: manual calculatin of the RAND function

    I'm not certain about your process, so this might or might not "fit". The following code responds each time you change a cell on the worksheet. If column C cells change to "buy" or "sell" AND there's no existing Ticket #, one is added. If they change to "", the corresponding Ticket #'s are cleared too. Let me know what you think.
    Please Login or Register  to view this content.
    To use this code:
    -Right-click on your worksheet Tab
    -Select View Code. This takes you to the Visual Basic Editor.
    -Paste the code in the Module that appears.
    -Close the Editor Window X to return to Excel.

    -Now click the File tab on the Main Ribbon
    -Select Save As and pick your folder.
    -Click in the Save as Type: box
    -Select Excel Macro-Enabled Workbook (*xlsm)
    -Change the filename (optional), then click Save
    NOTE- The NEW macro-enabled (.xlsm) workbook does not affect your existing .xlsx file. They are completely separate.
    You should eventually delete the old .xlsx version to avoid confusion.

    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Attached Files Attached Files
    Last edited by leelnich; 08-06-2017 at 03:23 AM. Reason: Minor change in code.

  6. #6
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Key West, FL
    MS-Off Ver
    365 Apps for Enterprise
    Posts
    665

    Re: manual calculatin of the RAND function

    Thanks, I'll check it out and get back to you!

+ 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] Rand function
    By Alexander Fischer in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-23-2006, 12:10 PM
  2. [SOLVED] Getting RAND() value but NOT function?!?
    By Mike in forum Excel General
    Replies: 2
    Last Post: 02-27-2006, 01:00 PM
  3. [SOLVED] Getting RAND() value but NOT its Function?!?
    By Mike in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-24-2006, 05:00 PM
  4. re: Rand function
    By Susan Hayes in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  5. [SOLVED] re: Rand function
    By Susan Hayes in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  6. [SOLVED] re: Rand function
    By Harlan Grove in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 06:05 AM
  7. re: Rand function
    By Susan Hayes in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  8. [SOLVED] re: Rand function
    By Susan Hayes in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM

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