+ Reply to Thread
Results 1 to 3 of 3

Macro to record sample results (with example sheet)

Hybrid View

Jeremy35 Macro to record sample... 02-13-2015, 11:53 AM
Bernie Deitrick Re: Macro to record sample... 02-13-2015, 12:52 PM
Jeremy35 Re: Macro to record sample... 02-13-2015, 01:08 PM
  1. #1
    Registered User
    Join Date
    02-05-2015
    Location
    Florida
    MS-Off Ver
    2013
    Posts
    30

    Macro to record sample results (with example sheet)

    I would like to have a macro that allows me to cycle a control group through 20 random samples while recording the resulting total for each sample in a separate record list. I have tried using the macro recorder provided in Excel, but have not been able to accomplish this.

    Attached is an example sheet.

    The step by step of the desired macro would be this:

    1. Re-Calculate sheet
    2. Record the total in the blue cell in the green cell adjacent to "Sample 1".
    3. Re-Calculate sheet
    4. Record the new total in the blue cell in the green cell adjacent to "Sample 2".
    5. Re-Calculate sheet
    6. Record the new total in the blue cell in the green cell adjacent to "Sample 3".
    .... all the way through sample 20 and then stop.

    Any help would be greatly appreciated!
    Attached Files Attached Files

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

    Re: Macro to record sample results (with example sheet)

    With the first sheet active, run this macro:

    Sub Get20RandomNumberSums()
        Dim i As Integer
        
        For i = 1 To 20
            Application.CalculateFull
            Cells(i + 2, "G").Value = Range("C14").Value
        Next i
    End Sub
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    02-05-2015
    Location
    Florida
    MS-Off Ver
    2013
    Posts
    30

    Re: Macro to record sample results (with example sheet)

    Thank you Bernie! Worked perfectly.

+ 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] Macro to copy record into another sheet
    By pdalal in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-13-2013, 09:52 AM
  2. VBA for copy record to sellected 2 sheet & clear entry sheet for new record
    By santosh226001 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-24-2012, 10:54 PM
  3. Macro to record sheet PDF
    By Flash_Azul in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-02-2011, 09:41 AM
  4. Record how often each number occurs -see sample
    By stat in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-22-2010, 03:32 PM
  5. Record macro and obtain variable range results?
    By Pierre in forum Excel General
    Replies: 2
    Last Post: 08-18-2006, 02:10 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