View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Lee Harris
 
Posts: n/a
Default Appending Random Results?


"DOR" wrote in message
...

I'm uploading a simple spreadsheet that does something like you want.

I created a Count named range in Sheet1 A1

The random results are in B1:G1.

A1:G1 is named Results

Log is a dynamic range on sheet two that eseentilally resolves to the
next open row in sheet 2 (or to be more precise the cell in column A of
the next open row in sheet 2)

The macro, initiated by the button copies values from Results to log
and then adds one to Count, which automatically causes recalc, creating
another set of random numbers. Youcan set Count to whatever you want
initially, the macro just adds one to it.

You can see where the code is stored by pressing alt-F11 and then
looking in module 1 of the spreadsheet.

For those who may not be able to download the spreadsheet the code
follows:

Sub LogResults()
Application.ScreenUpdating = False
Range("Results").Copy
Range("Log").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Range("Count") = Range("Count") + 1
Application.ScreenUpdating = True
End Sub

Hope it works for you.

Declan O'R


+-------------------------------------------------------------------+
|Filename: LogRandsData.zip |
|Download: http://www.excelforum.com/attachment.php?postid=4097 |
+-------------------------------------------------------------------+

--
DOR
------------------------------------------------------------------------
DOR's Profile:
http://www.excelforum.com/member.php...o&userid=29088
View this thread: http://www.excelforum.com/showthread...hreadid=490632


Thanks Declan, will have a play wit it now!
cheers