+ Reply to Thread
Results 1 to 4 of 4

Record Values when pressing F9

  1. #1
    Registered User
    Join Date
    04-21-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    2

    Record Values when pressing F9

    Hey guys, I need help figuring out how to record a value of a cell whenever F9 is pressed. The cell I want to record the value of is cell D101, which is a sum function of the previous 100 rows. I'd like to figure out a way to run 1,000 trials or so and record the value in cell D101 each time.

    Some more details, if needed: I'm simulating a dice game (craps). There are 2 dice, each dice is based off of RANDBETWEEN (1,6) then the dice are added in a different column to achieve the roll. The payout is then based on whatever number was rolled. I'm summing the payout (D101) and would like to run this trial 1,000 times.

    I've tried VBA and recording a macro but couldn't figure it out. I've researched a lot but still can't find the answer. Any help?

    Thanks.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,352

    Re: Record Values when pressing F9

    Hi BigC and welcome to the forum,

    Find attached a sample of what I think will help you figure out your problem. Let me know if it needs more work.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    04-21-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Record Values when pressing F9

    Thanks Marvin, I appreciate it. That will help me a lot, but honestly, the VBA code is above my understanding right now. I've attached the worksheet I made. It's messy, but basically the value I want to record is D101 on Sheet 2, which I bolded. Is there a quick fix? I don't want to be too time consuming.CrapsPayout.xlsm

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Record Values when pressing F9

    There's a craps simulation at https://www.box.com/s/de51996c2590157c61ca
    Entia non sunt multiplicanda sine necessitate

+ 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